本文发表在 rolia.net 枫下论坛usually when clients request asp.net page, asp.net will fire an constructor method ,but this never happend on microsoft sample program DUWAMISH for C#.
I find some strang things in this program:
At html documet , if I set TRACE property with FALSE value, the page constructor been invoked only whe the source code have been changed and need to recompile .
if I set trace property with TRUE value, then the constructor will be invoked every time when refreshing or requesting the page.
the following is the source code of DUWAMISH
public class Default : Page
{
public Default()
{
Page.Init += new System.EventHandler(Page_Init);
byte[] array={90,91};
try
{
System.IO.FileStream aa =new System.IO.FileStream (
"I:\\test.text",System.IO.FileMode.Append
);
aa.Write(array,1,1);
aa.Close();
}
catch(System.Exception e1)
{
}
finally
{
}
}
}更多精彩文章及讨论,请光临枫下论坛 rolia.net
I find some strang things in this program:
At html documet , if I set TRACE property with FALSE value, the page constructor been invoked only whe the source code have been changed and need to recompile .
if I set trace property with TRUE value, then the constructor will be invoked every time when refreshing or requesting the page.
the following is the source code of DUWAMISH
public class Default : Page
{
public Default()
{
Page.Init += new System.EventHandler(Page_Init);
byte[] array={90,91};
try
{
System.IO.FileStream aa =new System.IO.FileStream (
"I:\\test.text",System.IO.FileMode.Append
);
aa.Write(array,1,1);
aa.Close();
}
catch(System.Exception e1)
{
}
finally
{
}
}
}更多精彩文章及讨论,请光临枫下论坛 rolia.net