Click here to Skip to main content
11,481,404 members (63,656 online)
   

C#

 
AnswerRe: check array value exists Pin
OriginalGriff16-Aug-14 4:39
protectorOriginalGriff16-Aug-14 4:39 
QuestionCatching exceptions on backgroundworker Pin
pjank4215-Aug-14 20:44
memberpjank4215-Aug-14 20:44 
QuestionRe: Catching exceptions on backgroundworker Pin
Richard MacCutchan15-Aug-14 22:25
protectorRichard MacCutchan15-Aug-14 22:25 
AnswerRe: Catching exceptions on backgroundworker Pin
pjank4216-Aug-14 2:50
memberpjank4216-Aug-14 2:50 
GeneralRe: Catching exceptions on backgroundworker Pin
Richard MacCutchan16-Aug-14 6:10
protectorRichard MacCutchan16-Aug-14 6:10 
AnswerRe: Catching exceptions on backgroundworker Pin
Eddy Vluggen16-Aug-14 3:10
professionalEddy Vluggen16-Aug-14 3:10 
AnswerRe: Catching exceptions on backgroundworker Pin
jschell17-Aug-14 10:56
memberjschell17-Aug-14 10:56 
GeneralRe: Catching exceptions on backgroundworker Pin
pjank4218-Aug-14 9:40
memberpjank4218-Aug-14 9:40 
QuestionMissing TCP Packets Pin
M Riaz Bashir15-Aug-14 20:24
memberM Riaz Bashir15-Aug-14 20:24 
AnswerRe: Missing TCP Packets Pin
Dave Kreskowiak16-Aug-14 5:29
mvpDave Kreskowiak16-Aug-14 5:29 
GeneralRe: Missing TCP Packets Pin
M Riaz Bashir16-Aug-14 20:54
memberM Riaz Bashir16-Aug-14 20:54 
AnswerRe: Missing TCP Packets Pin
Rob Philpott16-Aug-14 7:34
professionalRob Philpott16-Aug-14 7:34 
GeneralRe: Missing TCP Packets Pin
M Riaz Bashir16-Aug-14 20:54
memberM Riaz Bashir16-Aug-14 20:54 
QuestionThread Freeze when trying Abort Pin
Member 1098515215-Aug-14 13:17
memberMember 1098515215-Aug-14 13:17 
Hi all
why does this form freeze when I press the strtChatBtn at the second time?

Server Form Class
    public partial class Server_Design : Form
    {
        Thread serverStart;
 
        private bool btnStartStop = true;
 
        public Server_Design()
        {
            InitializeComponent();
        }
 
        private void Server_Design_Load_1(object sender, EventArgs e)
        {
 
        }
 
        private void strtChatBtn_Click(object sender, EventArgs e)
        {
        
                if (btnStartStop)
                {
                        serverStart = new Thread(new         ThreadStart(Connection.StartListen));
                        serverStart.Start();                   
                        strtChatBtn.Text = "Stop Chat";
                        btnStartStop = false;
                }
                else
                {          
                    this.serverStart.Abort();              
                    Connection.StopListen();
                    strtChatBtn.Text = "Start Chat";
                    btnStartStop = true;
                }
 
        }
        }
    }

Connection Class
   public static class Connection
    {
        static IPAddress srvIP = IPAddress.Parse("127.0.0.1");
        static int srvPort = 8888;
 
        static TcpListener server = new TcpListener(srvIP, srvPort);
 
        public static void StartListen()
        {     
            server.Start();
 
            while (1 != 0)
            {
 
                TcpClient client = server.AcceptTcpClient();
 
                NetworkStream ns = client.GetStream();
                StreamWriter sw = new StreamWriter(ns);
                StreamReader sr = new StreamReader(ns);
 
                ns = client.GetStream();
 
                client.Close();
                ns.Close();
                sw.Close();
                sr.Close();
 
            }
        }
 
       public static void StopListen()
        {
            server.Stop();
        }
    }
}

GeneralRe: Thread Freeze when trying Abort Pin
PIEBALDconsult15-Aug-14 13:47
memberPIEBALDconsult15-Aug-14 13:47 
QuestionSummary Report in GridView [modified] Pin
sk_ko14-Aug-14 23:02
membersk_ko14-Aug-14 23:02 
AnswerRe: Summary Report in GridView Pin
Chris Quinn14-Aug-14 23:36
memberChris Quinn14-Aug-14 23:36 
AnswerRe: Summary Report in GridView Pin
Mycroft Holmes15-Aug-14 0:00
professionalMycroft Holmes15-Aug-14 0:00 
GeneralScope of Share point and Silverlight Pin
Member 1059394814-Aug-14 4:40
memberMember 1059394814-Aug-14 4:40 
GeneralRe: Scope of Share point and Silverlight Pin
Richard MacCutchan14-Aug-14 5:22
protectorRichard MacCutchan14-Aug-14 5:22 
Questionhow do i make each combo box to show a dropdown of the value of the Quantity it has fetched. Pin
Member 1050484913-Aug-14 10:02
memberMember 1050484913-Aug-14 10:02 
SuggestionRe: how do i make each combo box to show a dropdown of the value of the Quantity it has fetched. Pin
RyanDev13-Aug-14 10:24
mvpRyanDev13-Aug-14 10:24 
QuestionHow to increment div count in path Pin
Member 1098388513-Aug-14 7:09
memberMember 1098388513-Aug-14 7:09 
Questionc# Play Video Fullscreen Pin
Member 416962813-Aug-14 6:20
memberMember 416962813-Aug-14 6:20 
AnswerRe: c# Play Video Fullscreen Pin
Simon_Whale13-Aug-14 6:41
professionalSimon_Whale13-Aug-14 6:41 
GeneralRe: c# Play Video Fullscreen Pin
Member 416962813-Aug-14 6:53
memberMember 416962813-Aug-14 6:53 
GeneralRe: c# Play Video Fullscreen Pin
Dave Kreskowiak13-Aug-14 7:05
mvpDave Kreskowiak13-Aug-14 7:05 
GeneralRe: c# Play Video Fullscreen Pin
Member 416962813-Aug-14 9:42
memberMember 416962813-Aug-14 9:42 
GeneralRe: c# Play Video Fullscreen Pin
Dave Kreskowiak13-Aug-14 13:27
mvpDave Kreskowiak13-Aug-14 13:27 
GeneralRe: c# Play Video Fullscreen Pin
Bernhard Hiller13-Aug-14 22:48
professionalBernhard Hiller13-Aug-14 22:48 
Question[CheckBox ComboBox] Strange problem with ComboBox.CheckBoxItems[].Checked = true Pin
Member 1062093513-Aug-14 5:17
memberMember 1062093513-Aug-14 5:17 
SuggestionRe: [CheckBox ComboBox] Strange problem with ComboBox.CheckBoxItems[].Checked = true Pin
Richard Deeming13-Aug-14 5:57
professionalRichard Deeming13-Aug-14 5:57 
GeneralRe: [CheckBox ComboBox] Strange problem with ComboBox.CheckBoxItems[].Checked = true Pin
Member 1062093513-Aug-14 21:02
memberMember 1062093513-Aug-14 21:02 
QuestionRegarding the usage of generic in real life Pin
Tridip Bhattacharjee12-Aug-14 22:20
memberTridip Bhattacharjee12-Aug-14 22:20 
AnswerRe: Regarding the usage of generic in real life Pin
Manfred R. Bihy12-Aug-14 22:51
memberManfred R. Bihy12-Aug-14 22:51 
GeneralRe: Regarding the usage of generic in real life Pin
Tridip Bhattacharjee13-Aug-14 0:18
memberTridip Bhattacharjee13-Aug-14 0:18 
GeneralRe: Regarding the usage of generic in real life Pin
Debabrata TPX13-Aug-14 0:49
memberDebabrata TPX13-Aug-14 0:49 
GeneralRe: Regarding the usage of generic in real life Pin
Tridip Bhattacharjee13-Aug-14 22:25
memberTridip Bhattacharjee13-Aug-14 22:25 
GeneralRe: Regarding the usage of generic in real life Pin
Pete O'Hanlon13-Aug-14 22:46
protectorPete O'Hanlon13-Aug-14 22:46 
GeneralRe: Regarding the usage of generic in real life Pin
Pete O'Hanlon13-Aug-14 0:50
protectorPete O'Hanlon13-Aug-14 0:50 
QuestionHow to remove escape sequece from string while telnet to HP procurve devices Pin
superselector12-Aug-14 20:17
membersuperselector12-Aug-14 20:17 
AnswerRe: How to remove escape sequece from string while telnet to HP procurve devices Pin
OriginalGriff12-Aug-14 21:57
protectorOriginalGriff12-Aug-14 21:57 
AnswerRe: How to remove escape sequece from string while telnet to HP procurve devices Pin
OriginalGriff13-Aug-14 2:25
protectorOriginalGriff13-Aug-14 2:25 
GeneralRe: How to remove escape sequece from string while telnet to HP procurve devices Pin
superselector13-Aug-14 23:52
membersuperselector13-Aug-14 23:52 
GeneralRe: How to remove escape sequece from string while telnet to HP procurve devices Pin
OriginalGriff14-Aug-14 0:01
protectorOriginalGriff14-Aug-14 0:01 
AnswerRe: How to remove escape sequece from string while telnet to HP procurve devices Pin
Member 1028463313-Aug-14 3:22
memberMember 1028463313-Aug-14 3:22 
QuestionC# Creating Setup Problem Pin
Member 1094435912-Aug-14 0:16
memberMember 1094435912-Aug-14 0:16 
AnswerRe: C# Creating Setup Problem Pin
Dave Kreskowiak12-Aug-14 3:44
mvpDave Kreskowiak12-Aug-14 3:44 
GeneralRe: C# Creating Setup Problem Pin
Member 1094435912-Aug-14 4:50
memberMember 1094435912-Aug-14 4:50 
GeneralRe: C# Creating Setup Problem Pin
Dave Kreskowiak12-Aug-14 4:54
mvpDave Kreskowiak12-Aug-14 4:54 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 24 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid