Jump to content


Check out our Community Blogs

Colo's Content

There have been 1 items by Colo (Search limited from 14-December 18)


Sort by                Order  

#560853 StreamWriter?

Posted by Colo on 23 June 2010 - 09:17 AM in C#

Hello.
I was wondering if someone could tell me why my script isn't working?

I expect it to write "Hello word" to log.txt on my desktop?

public struct _cnf
    {
        public string logS;
    }

     static void form1(_cnf cnf)
     {
         cnf.logS = "C:\\Users\\Tom\\Desktop\\log.txt";
         StreamWriter logF = new StreamWriter(cnf.logS);
         logF.WriteLine("Hello World");
     }

There are no compiling errors, it just doesn't write anything in log.txt

any ideas? :(

thanks.




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download