This log file is stored inProgramIn the bin folder
Static Private String Logpathlog = appdomain. currentdomain. basedirectory + " Log.txt " ;
Static Public Void Writelog ( String Classname)
{
String Path = logpathlog;
If (! File. exists (PATH ))
{
// Create a file to write.
Using (File. Create (PATH )){}
}
Fileinfo = New Fileinfo (PATH );
If (Fileinfo. length> 1024 * 1024 * 2 )
{
File. Move (path, appdomain. currentdomain. basedirectory + datetime. Now. tostring ( " Yyyymmddhhmmss " ) + " Log.txt " );
If (! File. exists (PATH ))
{
Using (File. Create (PATH )){}
}
}
Using (Streamwriter Sw = file. appendtext (PATH ))
{
Sw. writeline (datetime. Now. tostring ( " Yyyy-mm-dd hh: mm: SS " ) + " : " + " \ T \ n " );
Sw. writeline (classname + " \ T \ n " );
Sw. writeline ( " ------------------------------------------------------------------------ " + " \ T \ n " );
Sw. Close ();
}
}