-----------------------------------------------------------

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: hereticmirror
Message 6 in Discussion

hey,

I tried the following code and ran from the console and asp.net application 
simultaneously...you try this in your environment and let me know if it works...

Code:
public class Class1
    {
        static TextWriter tw;
        public Class1(string text)
        {
            
        }
        
        
        public static void WriteText(string text)
        {
            if (tw == null)
                tw = 
TextWriter.Synchronized(File.AppendText(@"c:\InvalidPathChars.txt"));

            lock (tw)
            {
                tw.WriteLine(text);
            }
        }

Console App Code:
static void Main(string[] args)
        {
            for (long i = 0; i <= 10000000; i++)
            {
                ClassLibrary1.Class1.WriteText("Console Application.");
            }
        }

Asp.Net Code:
protected void Page_Load(object sender, EventArgs e)
    {
        for (long i = 0; i <= 10000000; i++)
        {
            ClassLibrary1.Class1.WriteText("ASP.NET Application");
        }
    }

Regards

Javeed


-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/MumbaiUserGroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to