473,325 Members | 2,308 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,325 software developers and data experts.

I have a consoleApplication poject and I need a Form to run with the project also

2
I'm working on a client/server application.The client is a window Form and the server is a Console Application.
But now I also need a form in the server application,which I added. but if I call the form from
the main function it only shows a white form. If I call it from the receive function af the server the same happens.
Where do I have to call it from so it can work properly?

From the main function

static void Main(string[] args)
{

Form1 f1= new Form1 ();
f1.Show ();
try
{



Server s=new Server(9811);
s.receive();






}
catch(Exception e)
{
System.Console.WriteLine("Exceptie1..."+e);
}




}


From receive function

public void receive()
{


try
{

ss=new TcpListener(port);
}
catch
{
Console.WriteLine("Err la ServerSocket !");
}
ss.Start();



Form1 f1= new Form1 ();
f1.Show ();



while (true)
{
client=ss.AcceptTcpClient();
ns=client.GetStream();
sin = new StreamReader (ns);
sout = new StreamWriter(ns);
sout.AutoFlush=true;
MyThread th = new MyThread(sin,sout,listaS);
ThreadStart tStart=new ThreadStart(th.run);
Thread t=new Thread(tStart);
t.Start();



}

// sout.Close();
sin.Close();
}


}
Jun 10 '06 #1
0 1499

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

Similar topics

1
by: dit | last post by:
I want to start something small, like a learning program. I've been looking and learning python for about 4 months; and I think that I have the basics under my belt... is it worth trying my own...
10
by: Tom | last post by:
I am looking for some ideas for how to design the layout of the form for data entry and to display the data for the following situation: There are many sales associates. A sales associate can work...
3
by: chris | last post by:
Hallo, I am in need of a replacement for the Microsoft Visual Studio .NET. The reason is quiet simple. I develop forms which are used on different microsoft windows platform, and one...
10
by: Dave Taylor | last post by:
I have a VB.NET WinForms project that has about 15 forms in it. When I opened the project yesterday, one of the form files does not open as a form (i.e. double-clicking it in Solution Explorer...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
0
by: NETCODE | last post by:
I am developing an add-in. I need to retrieve the path of .msi file, located in under project properties, from the deployment project (setup). I was able retieve all project properties of all...
4
by: adam_kroger | last post by:
BRIEF EXPLANATION: I have 6 TextBoxes named LIS1, LIS2, LIS3, ... LIS6. I want to be able to reference them using a For/Next loop and either read ot write to them. In VBA I would use something...
1
by: javabeginner123 | last post by:
i have a java prob, and i have to solve it fast, but i'm just getting to know it, so plz help me solve it with full code completed, thanks so much. the prob is to create a monter fight and there is...
1
by: viveksonalgupta | last post by:
can u send me the project on railway reservation management system
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.