I gang

Multithreading a windows application

This is my loop it calls GetFileVoters2012(Phone) that function needs to be multi-threaded.

Your bid needs to included time test and confirm code.

private void processVoter2012()

{

Int64 ID = 0;

string Phone = "";

SqlConnection cn = new SqlConnection([url removed, login to view]);

SqlCommand cmd = new SqlCommand("usp_SelectVoters2012PhoneNumbers", cn);

[url removed, login to view] = [url removed, login to view];

[url removed, login to view]("@City", [url removed, login to view]);

[url removed, login to view] = 0;

[url removed, login to view]();

SqlDataReader dr = [url removed, login to view]();

while ([url removed, login to view]())

{

Phone = [url removed, login to view]([url removed, login to view]("Phone"));

// Thread t = new Thread(()=>GetFileVoters2012(Phone)); // Kick off a new thread

// [url removed, login to view]();

// [url removed, login to view](1000);

GetFileVoters2012(Phone);

}

[url removed, login to view]();

}

public void GetFileVoters2012(string Phone)

{

string npa="",qnxx="",qstation="";

if ([url removed, login to view] == 7)

Phone = "954" + Phone;

if ([url removed, login to view] == 10)

{

npa = [url removed, login to view](0, 3);

qnxx = [url removed, login to view](3, 3);

qstation = [url removed, login to view](6, 4);

string strURL = "[url removed, login to view]" + npa + "&qnxx=" + qnxx + "&qstation=" + qstation + "&focusfirst=1";

string Listofphone = "", phone = "", tst = "", PhoneType = "";

Int32 i = 0;

double num;

Boolean isNum;

try

{

WebRequest myWebRequest = [url removed, login to view](strURL);

WebResponse myWebResponse = [url removed, login to view]();

Stream ReceiveStream = [url removed, login to view]();

Encoding encode = [url removed, login to view]("utf-8");

StreamReader readStream = new StreamReader(ReceiveStream, encode);

string strResponse;

while ((strResponse = [url removed, login to view]()) != null && PhoneType=="")

{

/*

StreamWriter oSw = new StreamWriter(strFilePath);

[url removed, login to view](strResponse);

[url removed, login to view]();

[url removed, login to view]();

*/

i = [url removed, login to view]("Land Line");

if (i > 0)

PhoneType = "L";

i = [url removed, login to view]("Cellular");

if (i > 0)

PhoneType = "C";

i = [url removed, login to view]("Paging");

if (i > 0)

PhoneType = "P";

}

[url removed, login to view]();

}

catch { }

[url removed, login to view] = Phone + "- " + PhoneType;

[url removed, login to view]();

SqlConnection conn = new SqlConnection([url removed, login to view]);

SqlCommand cmd = new SqlCommand("usp_InsertVoters2012PhoneType", conn);

[url removed, login to view] = [url removed, login to view];

//save ROS

// [url removed, login to view]("@Phone", ID);

[url removed, login to view]("@Phone", Phone);

[url removed, login to view]("@PhoneType", PhoneType);

[url removed, login to view]();

[url removed, login to view]();

[url removed, login to view]();

}

}

GlobalVariables.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BrowardCountyVotersImport
{
class GlobalVariables
{
private static string m_sqlserver = "";
public static string sqlserver
{
get { return m_sqlserver; }
set { m_sqlserver = value; }
}
}
}

Færdigheder: .NET, C# Programmering

Se mere: windows phone 10, windows 8 programming, while loop c programming, thread programming, substring c, sleep programming, programming loop, p.c. connection, multi thread programming, multithreading programming, multi threaded programming, loop programming, loop net, c substring, c string substring, c sharp test, c # sharp test, c programming while loop, c programming boolean, boolean programming, multi phone line system, Windows Application C#, ros, osw, multithreading

Om arbejdsgiveren:
( 3 bedømmelser ) Popano Beach, United States

Projekt-ID: #4068105

Tildelt til:

alliaunce

Hi, could you share the GlobalVariables file?, will get back to you with a demo App. Thanks

$75 USD in 3 dage
(7 bedømmelser)
3.3

2 freelancere byder i gennemsnit $65 for dette job

traihdvn

I have experience with multi thread winform. I can help you. Regards

$55 USD på 1 dag
(1 bedømmelse)
1.0