You are not logged in.

myfairlady

Beginner

  • "myfairlady" started this thread

Posts: 1

Occupation: Software Engineer

  • Send private message

1

Wednesday, February 2nd 2005, 8:38am

How to get IP address from Computer name

I have written code to connect to a server using QSocket. I am able to connect if i give the IP address of the server in the 'connectToHost()' method of QSocket.

Now Suppose if i want to give the server computer name in place of the IP address and still get connection, how do i do that.
First of all can I do so? ?(

Its smthing like suppose the server name is "abcxyz" and IP is 192.168.4.168....
i can connect by connectToHost("192.168.4.168", 8080)

But can I connect using connectToHost("abcxyz", 8080) .
If so how can i do this. If i directly give the name it was giving some exception.

Please Help

wysota

Trainee

Posts: 65

Location: Warsaw, POLAND

  • Send private message

2

Wednesday, February 2nd 2005, 9:14am

RE: How to get IP address from Computer name

Live and let live - use the search engine.
"Use the docs Luke, use the docs!"