Wednesday, February 9, 2011

Get a lot of free space if clear up .itrace files in VS 2010

Get  a lot of free space if clear up .itrace files in VS 2010
.itrace file is about 40MB.  Under folder:
C:\ProgramData\Microsoft Visual Studio\10.0\TraceDebuggin

Itrace ifle captures the current state of the debugger at multiple points during a program’s execution.
Reference:

Monday, February 7, 2011

What is maximum upload file size in asp.net, and how to set up, MaxRequestLength

What is maximum upload file size in asp.net, and how to set up,  MaxRequestLength
You can change this setting in web.config:
<system.web>
  <httpRuntime  maxRequestLength="102400" executionTimeout="360"/>
</system.web>

If this attribute set to limited size, can be used to prevent denial of service attacks (DOS).

Default value:  4096 (4 MB).
Maxium size:  1048576 (1 GB) for .NET Framework 1.0/1.1 and 2097151 (2 GB) for .NET Framework 2.0.

Reference:
http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxrequestlength.aspx

Sunday, February 6, 2011

Understand Lambda and anonomous function by reading code

Example code for anonomous function
Before
button1.Click += new EventHandler(button1_Click);
void button1_Click (object sender, EventArgs e)
{
textbox1.Text = DateTime.Now.ToShortDateString();
}

After Lambda Code:
button1.Click += (s, e) => { textbox1.Text = DateTime.Now.TosShortDateString(); } ;