Click here to Skip to main content
15,889,096 members
Home / Discussions / C#
   

C#

 
QuestionHow I can fill up the DataGridView with empy rows Pin
unikum6-Sep-06 18:07
unikum6-Sep-06 18:07 
QuestionCreating Installation file Pin
Niiiissssshhhhhuuuuu6-Sep-06 17:51
Niiiissssshhhhhuuuuu6-Sep-06 17:51 
AnswerRe: Creating Installation file Pin
Utkarshraj Atmaram6-Sep-06 18:55
Utkarshraj Atmaram6-Sep-06 18:55 
QuestionNested Collections Pin
xfitr26-Sep-06 17:05
xfitr26-Sep-06 17:05 
AnswerRe: Nested Collections Pin
MIHAI_MTZ6-Sep-06 21:01
MIHAI_MTZ6-Sep-06 21:01 
QuestionYour favourite/best C# 2.0 Book? Pin
James_1236-Sep-06 15:38
James_1236-Sep-06 15:38 
AnswerRe: Your favourite/best C# 2.0 Book? Pin
Andrei Ungureanu6-Sep-06 20:00
Andrei Ungureanu6-Sep-06 20:00 
QuestionHelp ThreadPools/Threads Pin
peterzorbas6-Sep-06 13:30
peterzorbas6-Sep-06 13:30 
Im writing an application that will use the HTTPSocket class in SystemNet. I have checked the msdn documentation regarding thread safety which infact is safe to deploy the class in a thread however im unable to reach a code point of execution where data is supposed to be displayed. Better yet let me copy paste some simple code for everyone to see. The results are dubious.

class MyThreadPool
{
private static int i;
private string web_response;
private string company;
private long thread_id;

public MyThreadPool() { }

public MyThreadPool(string business_string, long id)
{
this.company = business_string;
this.thread_id = id;
ThreadPool.QueueUserWorkItem(new WaitCallback(HackCorps), new AutoResetEvent(true));
}

public void HackCorps(Object state)
{
string[] business = null;
business = this.company.Split('^');

Stream business_stream = WebRequest.Create(business[0]).GetResponse().GetResponseStream();

StreamReader business_reader = new StreamReader(business_stream);
Console.WriteLine(++i);
}
}

and the main

int main(){
string line = null;
long i = 0;
StreamReader read_business = new StreamReader("f://directory.txt");
while ((line = read_business.ReadLine()) != null)
{
MyThreadPool pool = new MyThreadPool(line, ++i);
}return 0;<----Code get here since all thread classes are created although they aren't processed will cause the probram to terminate. Is there some sort of lock to prevent this?
}


Thanks for your help...
QuestionCopy and Past shortcuts stop working when derived form shown non-modally. Pin
Vengeance6-Sep-06 12:50
Vengeance6-Sep-06 12:50 
Questiongeneric inherited class Pin
daveroberge6-Sep-06 9:33
daveroberge6-Sep-06 9:33 
AnswerRe: generic inherited class Pin
Nader Elshehabi6-Sep-06 10:17
Nader Elshehabi6-Sep-06 10:17 
GeneralRe: generic inherited class Pin
daveroberge6-Sep-06 10:46
daveroberge6-Sep-06 10:46 
QuestionRe: generic inherited class Pin
Nader Elshehabi6-Sep-06 11:30
Nader Elshehabi6-Sep-06 11:30 
AnswerRe: generic inherited class Pin
daveroberge6-Sep-06 14:04
daveroberge6-Sep-06 14:04 
AnswerRe: generic inherited class Pin
Nader Elshehabi7-Sep-06 1:59
Nader Elshehabi7-Sep-06 1:59 
GeneralRe: generic inherited class Pin
daveroberge7-Sep-06 3:07
daveroberge7-Sep-06 3:07 
GeneralRe: generic inherited class Pin
Nader Elshehabi7-Sep-06 9:04
Nader Elshehabi7-Sep-06 9:04 
GeneralRe: generic inherited class Pin
daveroberge7-Sep-06 10:53
daveroberge7-Sep-06 10:53 
GeneralRe: generic inherited class Pin
Nader Elshehabi7-Sep-06 11:26
Nader Elshehabi7-Sep-06 11:26 
GeneralRe: generic inherited class Pin
daveroberge7-Sep-06 14:31
daveroberge7-Sep-06 14:31 
AnswerRe: generic inherited class Pin
Ed.Poore6-Sep-06 12:01
Ed.Poore6-Sep-06 12:01 
GeneralRe: generic inherited class Pin
daveroberge6-Sep-06 14:09
daveroberge6-Sep-06 14:09 
GeneralRe: generic inherited class Pin
Ed.Poore6-Sep-06 18:38
Ed.Poore6-Sep-06 18:38 
GeneralRe: generic inherited class Pin
daveroberge7-Sep-06 2:54
daveroberge7-Sep-06 2:54 
QuestionPlacing description into a class/method??? Pin
Goalie356-Sep-06 8:55
Goalie356-Sep-06 8:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.