473,398 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Server Console and Form ?

3
Hello, I'm trying to write a multithreaded TCP server program, I want it to run in a console and continual check for incoming connections.
EX.....
Expand|Select|Wrap|Line Numbers
  1.  
  2.        while (true)
  3.        {
  4.            clientSocket = serverSocket.AcceptTcpClient();
  5.            handleClient client = new handleClient();
  6.            client.startClient(clientSocket,Convert.ToString(counter));
  7.             }
  8.  
the problem is that i also want a Form with buttons that can control the server, i try but the From always freezes.
I'm a bit new Visual Studio C# sorry if this is really simple.

thanks
Nov 26 '11 #1
2 2174
GaryTexmo
1,501 Expert 1GB
The general idea is that you need to create a new windows application, then change the output to a console application. Now you can create a new thread with your GUI in it and start that from the console application. Then you can make the console application part do whatever you want.

I googled around and here's a pretty good example of the above. This person takes it a step farther and uses delegates to communicate between the console and the form.

http://balau82.wordpress.com/2009/04...m-and-console/
Nov 28 '11 #2
Dusted
3
thank you, I've got it working, helped a lot.
Nov 28 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Tom | last post by:
Hi all, I posted the same question one week ago in http://communities.microsoft.com/newsgroups/previewFrame.as p? ICP=msdn&sLCID=us&sgroupURL=microsoft.public.dotnet.framewo...
1
by: Ray Cacciatore | last post by:
My login.aspx page uses a MasterPage and is implemented as a Content page. However, I keep getting the error "A page can have only one server-side Form tag." when I run it. Yet there is not FORM tag...
2
by: VB Programmer | last post by:
I only have 1 set of <FORM> tags in my HTML file, but I keep getting this error. Any ideas? *********** A page can have only one server-side Form tag. Description: An unhandled exception...
1
by: ScottF | last post by:
There was a problem with ASP.Net 1.1 creating/generating bad javascript on html pages that I ran into and on the KB page that I had found at the time it said that the problem was fixed in the .Net...
4
by: Lee Chapman | last post by:
Hi, Can anyone tell me why in the code below, the call to ClearChildViewState() has no effect? To paraphrase the code: I'm using view state. I have a textbox and a submit button (and a label...
7
by: h7qvnk7q001 | last post by:
I'm trying to implement a simple server-side form validation (No Javascript). If the user submits a form with errors, I want to redisplay the same form with the errors highlighted. Once the form...
2
by: AlecL | last post by:
I have a page that has about 5 or 6 user controls ranging from hearders to footers to ad space but when I add a new user control which is a form it gives me the exception "page can have only one...
1
by: Deane | last post by:
I've run into this problem on many occasions -- I need to have the server side form tag on my Web form, of course. But I also need to have *another* form on the page that posts to a URL...
1
by: me2tech | last post by:
I installed Apache Tomcat 6.0 through window installer exe file in windows 2000 OS. Although the server runs perfectly, I need to see the server console which is not visible to me. As the start...
1
by: StevenT | last post by:
I have searched everywhere and found a lot of information on this but nothing that can fix my problem. This is my shopping cart HTML, I eventually realised I dont need a form tag here because I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.