Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
GeneralRe: Instantiating an array of objects Pin
Nick Parker29-Jul-04 9:11
protectorNick Parker29-Jul-04 9:11 
GeneralRe: Instantiating an array of objects Pin
crushinghellhammer29-Jul-04 9:32
crushinghellhammer29-Jul-04 9:32 
GeneralRe: Instantiating an array of objects Pin
Nick Parker29-Jul-04 10:11
protectorNick Parker29-Jul-04 10:11 
GeneralWM_PRINT for themed controls Pin
Mathew Hall29-Jul-04 6:31
Mathew Hall29-Jul-04 6:31 
GeneralRe: WM_PRINT for themed controls Pin
Heath Stewart29-Jul-04 9:25
protectorHeath Stewart29-Jul-04 9:25 
GeneralCalculating Point locations in relation to Parent client area. Pin
Tristan Rhodes29-Jul-04 6:27
Tristan Rhodes29-Jul-04 6:27 
GeneralRe: Calculating Point locations in relation to Parent client area. Pin
Nick Parker29-Jul-04 8:06
protectorNick Parker29-Jul-04 8:06 
GeneralRe: Calculating Point locations in relation to Parent client area. Pin
Anonymous30-Jul-04 13:42
Anonymous30-Jul-04 13:42 
GeneralCheckedListBox event handling strangeness Pin
James Kolpack29-Jul-04 5:32
James Kolpack29-Jul-04 5:32 
GeneralRe: CheckedListBox event handling strangeness Pin
Nick Parker29-Jul-04 8:01
protectorNick Parker29-Jul-04 8:01 
GeneralRe: CheckedListBox event handling strangeness Pin
James Kolpack29-Jul-04 8:31
James Kolpack29-Jul-04 8:31 
GeneralRe: CheckedListBox event handling strangeness Pin
James Kolpack29-Jul-04 11:12
James Kolpack29-Jul-04 11:12 
GeneralC# DataGrid - how to get the sort arrow in column header Pin
T J Manjaly29-Jul-04 5:03
sussT J Manjaly29-Jul-04 5:03 
GeneralColumn selection control needed Pin
Jan R Hansen29-Jul-04 4:38
Jan R Hansen29-Jul-04 4:38 
GeneralRe: Column selection control needed Pin
billb211229-Jul-04 4:52
billb211229-Jul-04 4:52 
GeneralRe: Column selection control needed Pin
Nick Parker29-Jul-04 5:33
protectorNick Parker29-Jul-04 5:33 
GeneralDns.GetHostByAddress problem Pin
Dave@keyspell29-Jul-04 4:12
sussDave@keyspell29-Jul-04 4:12 
Hi all

I have a problem with my program, I'm trying to send data between two computers. The problem is this, I can send data between the client app and server app (which is on my other computer, through wirless connection) as long as I specify the HostName i.e. "dave", then use the IPHostEntry.Resolve to get the ip address. I don't want to use the HostName as the app will run over the internet, so my client app sends it's ip address to the server, the server then try's to send data back to the client using the given ip address but gets stuck in a loop as it keeps sending itself the data not the client. When I had a look at the ip address the server was recieving it ok but when i had a look at the HostName that the server was producing from the ip address, it was refering to itself not the client.

Would this be anything to do with the fact that its over a local network and not the internet?

My Server Code is below:

TcpClient tcpc = new TcpClient();
int port = 5656;
string[] server = o.WhosOnline();
IPHostEntry IPHost;
string []aliases;
bool loggedin = false;
IPAddress[] addr;

bool success;
success = o.loguser(cmd[2].ToString());
//IPHost = Dns.Resolve("dave") <-- I DONT WANT TO USE THIS
IPHost = Dns.GetHostByAddress("192.168.0.1"); <-- I NEED SOMTHING LIKE THIS
Console.WriteLine("Host Name: " + IPHost.HostName); <-- DISPLAYS SERVER NAME
aliases = IPHost.Aliases;
Console.WriteLine(IPHost.AddressList[0].ToString()); <-- DISPLAYS CLIENTS IP
addr = IPHost.AddressList;
IPEndPoint ep = new IPEndPoint(addr[0], port);
tcpc.Connect(ep);
// Get the stream
Stream s = tcpc.GetStream();
StreamWriter r = new StreamWriter(s);
r.Write(stream);
r.Flush();
r.Close();
s.Close();
tcpc.Close();
Console.WriteLine("sent");

Can anyone help?
GeneralRe: Dns.GetHostByAddress problem Pin
Heath Stewart29-Jul-04 4:41
protectorHeath Stewart29-Jul-04 4:41 
GeneralRe: Dns.GetHostByAddress problem Pin
Dave@keyspell29-Jul-04 5:31
sussDave@keyspell29-Jul-04 5:31 
QuestionHow to Export to CSV file from DataSet? Pin
HyVong29-Jul-04 3:11
HyVong29-Jul-04 3:11 
AnswerRe: How to Export to CSV file from DataSet? Pin
Not Active29-Jul-04 4:13
mentorNot Active29-Jul-04 4:13 
AnswerRe: How to Export to CSV file from DataSet? Pin
Michael P Butler29-Jul-04 4:35
Michael P Butler29-Jul-04 4:35 
QuestionHow hard will it be to move to C# 2.0 ? Pin
Andres Coder29-Jul-04 3:02
Andres Coder29-Jul-04 3:02 
AnswerRe: How hard will it be to move to C# 2.0 ? Pin
SOCM_FP_CPP29-Jul-04 3:11
SOCM_FP_CPP29-Jul-04 3:11 
GeneralRe: How hard will it be to move to C# 2.0 ? Pin
Nick Parker29-Jul-04 5:07
protectorNick Parker29-Jul-04 5:07 

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.