Jason

Jason

  • NA
  • 3
  • 0

Java Vs C#

Nov 21 2005 3:50 AM
Hello All,
            Was wondering if anyone could help me. I've just started to learn C# and began converting a program I wrote in Java.

In Java:
public URL(String protocol,
           String host,
           int port,
           String file)
    throws MalformedURLException I can specifythe protocol, host, port & file. So I can write:
URL url = new URL("http","137.223.238.110",8085,"/server_push.html/ServerPush"); or alternatively URL url = new URL("http://" + deviceAddress + ":8085/server_push.html/ServerPush");

In C#, I need to do exactly the same thing, ie point to a file and open a stream.
It would appear that I cannot do-

TcpClient tcpclnt = new TcpClient("137.223.238.110/server_push.html/ServerPush",8085);
or
IPAddress IppA =
Dns.Resolve("137.223.238.110/server_push.html/ServerPush").AddressList[0];

TcpClient tcpclnt = new TcpClient(IppA,8085)

Everything works if I remove the "/server_push.html/ServerPush" but on the device Im working with I need specifically to refer to this file.

Any help for a C# newbie would be much appreciated.

Many Thanks,
Jason


Answers (1)