Beispiel #1
0
        private void Worker1(object data)
        {
            ThreadData tData = (ThreadData)data;

            try
            {
                //for (int i = 0; i < 10000; i++)
                //{
                //    int j = (i * 100) / 10;
                //}
                tData.MutexWaitOne();
                string[] searchValues = tData.SetRangeValue();
                tData.Release();
                foreach (string s in searchValues)
                {
                    try
                    {
                        System.Net.WebClient wb = new System.Net.WebClient();
                        wb.DownloadFile("http://www.google.com/search?q=" + s, s + "_MultiThread.html");
                    }
                    catch
                    {
                    }
                }
            }
            catch (Exception e)
            {
                tData.Release();
                //System.Windows.Forms.MessageBox.Show(e.Message);
            }
        }