Threading C#.NET PROGRAM

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace file
{
    class Program
    {
        static void Main(string[] args)
        {
            Thread t = new Thread(WriteY);
            t.Start();                          // Run WriteY on the new thread   
            while (true) Console.Write ("x");   // Write 'x' forever
            }
         static void WriteY()
         {  
             while (true) Console.Write ("y");   // Write 'y' forever 
         }
    }
}

OUTPUT


Multithreading
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace filestream
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }
        public delegate void new_foo_delegate();
        void new_foo()
        {
            textBox1.Text = "Hullo";
        }
        void foo()
        {
            textBox1.Invoke(new new_foo_delegate(new_foo));
        }
        private void button1_Click(object sender, EventArgs e)
        {
        Thread t=new Thread(new ThreadStart(foo));
            t.Start();
        }
    }
       
    }

OUTPUT 
 
Share:

Total Pageviews

CONTACT US

Prof. Roshan P. Helonde
Mobile: +917276355704
WhatsApp: +917276355704
Email: roshanphelonde@rediffmail.com

Enter Project Title

Popular Projects

All Archive

Contact Form

Name

Email *

Message *