Click here to Skip to main content
15,887,367 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to increase the scope in an if statement Pin
harold aptroot11-Jul-09 13:03
harold aptroot11-Jul-09 13:03 
AnswerRe: How to increase the scope in an if statement Pin
Luc Pattyn11-Jul-09 13:59
sitebuilderLuc Pattyn11-Jul-09 13:59 
AnswerRe: How to increase the scope in an if statement Pin
DaveyM6911-Jul-09 14:21
professionalDaveyM6911-Jul-09 14:21 
QuestionHelp me to convert this code in Java into a C# code Pin
Member 333548911-Jul-09 9:46
Member 333548911-Jul-09 9:46 
AnswerRe: Help me to convert this code in Java into a C# code Pin
OriginalGriff11-Jul-09 10:36
mveOriginalGriff11-Jul-09 10:36 
AnswerRe: Help me to convert this code in Java into a C# code Pin
Member 333548911-Jul-09 10:56
Member 333548911-Jul-09 10:56 
GeneralRe: Help me to convert this code in Java into a C# code Pin
DaveyM6911-Jul-09 11:35
professionalDaveyM6911-Jul-09 11:35 
GeneralRe: Help me to convert this code in Java into a C# code Pin
Member 333548911-Jul-09 16:14
Member 333548911-Jul-09 16:14 
I have tried in this mode:

using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Configuration;



class Server
{
public static void Main()
{
// Message terminator
char EOF = (char)0x00;

try
{
IPAddress ipAd = IPAddress.Parse("127.0.0.1");

/* Initializes the Listener */
TcpListener myList = new TcpListener(ipAd, 2055);

/* Start Listeneting at the specified port */
myList.Start();

Console.WriteLine("The server is running. Waiting for a connection....");

Socket soc = myList.AcceptSocket();


Stream s = new NetworkStream(soc);
StreamReader sr = new StreamReader(s);
StreamWriter sw = new StreamWriter(s);

sw.WriteLine("Benvenuti sul server! digita EXIT per disconnetterti." + EOF);
sw.Flush();


bool quit = false;

while (!quit)
{
string msg = sr.ReadLine();

if (msg == null) quit = true;

if (msg != "EXIT")
{
sw.WriteLine("Guest: <b>" + msg + "</b>" + EOF);
sw.Flush();
}
else
{
quit = true;
}

} // end while
}
catch (Exception e)
{
Console.WriteLine(e.Message);

}
}
}

GeneralRe: Help me to convert this code in Java into a C# code Pin
DaveyM6912-Jul-09 7:57
professionalDaveyM6912-Jul-09 7:57 
AnswerRe: Help me to convert this code in Java into a C# code Pin
Nathan Revka11-Jul-09 12:55
Nathan Revka11-Jul-09 12:55 
QuestionSearching a string in a binary file using BinaryReader Pin
SimpleData11-Jul-09 8:08
SimpleData11-Jul-09 8:08 
AnswerRe: Searching a string in a binary file using BinaryReader Pin
Eddy Vluggen11-Jul-09 8:28
professionalEddy Vluggen11-Jul-09 8:28 
GeneralRe: Searching a string in a binary file using BinaryReader [modified] Pin
SimpleData11-Jul-09 8:49
SimpleData11-Jul-09 8:49 
GeneralRe: Searching a string in a binary file using BinaryReader [modified] Pin
Eddy Vluggen11-Jul-09 10:32
professionalEddy Vluggen11-Jul-09 10:32 
GeneralRe: Searching a string in a binary file using BinaryReader Pin
Luc Pattyn11-Jul-09 14:08
sitebuilderLuc Pattyn11-Jul-09 14:08 
GeneralRe: Searching a string in a binary file using BinaryReader Pin
Eddy Vluggen12-Jul-09 0:54
professionalEddy Vluggen12-Jul-09 0:54 
GeneralRe: Searching a string in a binary file using BinaryReader Pin
Luc Pattyn12-Jul-09 5:20
sitebuilderLuc Pattyn12-Jul-09 5:20 
GeneralRe: Searching a string in a binary file using BinaryReader Pin
OriginalGriff11-Jul-09 10:48
mveOriginalGriff11-Jul-09 10:48 
GeneralRe: Searching a string in a binary file using BinaryReader Pin
harold aptroot11-Jul-09 13:19
harold aptroot11-Jul-09 13:19 
QuestionTime values in arraylist Pin
Member 398136611-Jul-09 3:39
Member 398136611-Jul-09 3:39 
AnswerRe: Time values in arraylist Pin
Henry Minute11-Jul-09 3:52
Henry Minute11-Jul-09 3:52 
GeneralRe: Time values in arraylist Pin
PIEBALDconsult11-Jul-09 7:04
mvePIEBALDconsult11-Jul-09 7:04 
QuestionRe: Time values in arraylist Pin
PIEBALDconsult11-Jul-09 4:23
mvePIEBALDconsult11-Jul-09 4:23 
Questionhi.. Pin
mjawadkhatri11-Jul-09 1:30
mjawadkhatri11-Jul-09 1:30 
AnswerRe: hi.. Pin
OriginalGriff11-Jul-09 1:42
mveOriginalGriff11-Jul-09 1:42 

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.