Click here to Skip to main content
16,017,151 members
Home / Discussions / C#
   

C#

 
AnswerRe: web and window applications that work on one same database file Pin
Christian Graus7-Oct-09 11:05
protectorChristian Graus7-Oct-09 11:05 
QuestionWhy server doesn't respond? Pin
Aljaz1117-Oct-09 7:46
Aljaz1117-Oct-09 7:46 
AnswerRe: Why server doesn't respond? Pin
Luc Pattyn7-Oct-09 9:05
sitebuilderLuc Pattyn7-Oct-09 9:05 
GeneralRe: Why server doesn't respond? Pin
Aljaz1118-Oct-09 0:17
Aljaz1118-Oct-09 0:17 
GeneralRe: Why server doesn't respond? Pin
Luc Pattyn8-Oct-09 1:10
sitebuilderLuc Pattyn8-Oct-09 1:10 
GeneralRe: Why server doesn't respond? [modified] Pin
Aljaz1118-Oct-09 5:31
Aljaz1118-Oct-09 5:31 
GeneralRe: Why server doesn't respond? Pin
Luc Pattyn8-Oct-09 5:49
sitebuilderLuc Pattyn8-Oct-09 5:49 
GeneralRe: Why server doesn't respond? Pin
Aljaz1118-Oct-09 5:55
Aljaz1118-Oct-09 5:55 
Here is my code for sending:
private void poslji()
        {

            novo = textbox();
            NetworkStream networkStream = odjemalec.GetStream(); //odjemalec if global variable
            StreamReader streamReader = new StreamReader(networkStream);
            StreamWriter streamWriter = new StreamWriter(networkStream);
            
            streamWriter.WriteLine(novo);
            Console.WriteLine("Pošiljam sporočilo...");
            streamWriter.Flush();
            string s = streamReader.ReadLine();


            textBox1.Text = s;

            Console.WriteLine("Prejemam sporočilo...");
            Console.WriteLine(s);

            streamReader.Close();
            streamWriter.Close();
            networkStream.Close();

                
                    
        }


And here is code for server in server_load form:
try
            {
                IPAddress ipAd = IPAddress.Parse("127.0.0.1");
                

               
                TcpListener myList = new TcpListener(ipAd, int.Parse("1111"));

              
                myList.Start();

                Socket socketForClient = myList.AcceptSocket();

                Console.WriteLine("Odjemalec povezan " + socketForClient.RemoteEndPoint.ToString());
                NetworkStream networkStream = new NetworkStream(socketForClient);
                StreamWriter streamWriter = new StreamWriter(networkStream);
                StreamReader streamReader = new StreamReader(networkStream);
                string line = streamReader.ReadLine();
                Console.WriteLine("Sprejeto: " + line);
                line = line.ToUpper();
                textBox1.Text = line;
                streamWriter.WriteLine(line);
                Console.WriteLine("Poslano: " + line);
                
                streamWriter.Flush();
                Console.WriteLine();
               
                //socketForClient.Close();
               // myList.Stop();


it sends first time..next time error that i pasted in post before.
QuestionHelp is needed (Urgent) Pin
jashimu7-Oct-09 7:40
jashimu7-Oct-09 7:40 
AnswerRe: Help is needed (Urgent) Pin
EliottA7-Oct-09 9:07
EliottA7-Oct-09 9:07 
QuestionWhat's special with message box? Pin
teknolog1237-Oct-09 6:56
teknolog1237-Oct-09 6:56 
AnswerRe: What's special with message box? Pin
PIEBALDconsult7-Oct-09 7:27
mvePIEBALDconsult7-Oct-09 7:27 
GeneralRe: What's special with message box? [modified] Pin
teknolog1237-Oct-09 7:37
teknolog1237-Oct-09 7:37 
GeneralRe: What's special with message box? Pin
LimitedAtonement7-Oct-09 7:42
LimitedAtonement7-Oct-09 7:42 
GeneralRe: What's special with message box? Pin
teknolog1237-Oct-09 8:09
teknolog1237-Oct-09 8:09 
GeneralRe: What's special with message box? Pin
PIEBALDconsult7-Oct-09 7:42
mvePIEBALDconsult7-Oct-09 7:42 
QuestionAnother method safer than StreamWriter and how can I save the file on another server (asp.net c sharp) Pin
aspkiddy7-Oct-09 6:32
aspkiddy7-Oct-09 6:32 
QuestionCode Readability Poll Pin
LimitedAtonement7-Oct-09 5:57
LimitedAtonement7-Oct-09 5:57 
AnswerRe: Code Readability Poll Pin
Kevin Marois7-Oct-09 6:34
professionalKevin Marois7-Oct-09 6:34 
GeneralRe: Code Readability Poll Pin
N a v a n e e t h7-Oct-09 7:38
N a v a n e e t h7-Oct-09 7:38 
GeneralRe: Code Readability Poll Pin
PIEBALDconsult7-Oct-09 8:22
mvePIEBALDconsult7-Oct-09 8:22 
GeneralRe: Code Readability Poll Pin
Gideon Engelberth7-Oct-09 9:14
Gideon Engelberth7-Oct-09 9:14 
GeneralRe: Code Readability Poll Pin
PIEBALDconsult7-Oct-09 13:49
mvePIEBALDconsult7-Oct-09 13:49 
AnswerRe: Code Readability Poll Pin
Luc Pattyn7-Oct-09 6:40
sitebuilderLuc Pattyn7-Oct-09 6:40 
GeneralRe: Code Readability Poll Pin
Ennis Ray Lynch, Jr.7-Oct-09 8:59
Ennis Ray Lynch, Jr.7-Oct-09 8:59 

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.