Results 1 to 2 of 2

Thread: Getting Host name

  1. #1

    Thread Starter
    Addicted Member MethadoneBoy's Avatar
    Join Date
    Oct 2001
    Location
    Preferably somewhere between Keira Knightley and Diane Kruger but I'm not fussy
    Posts
    180

    Getting Host name

    I'm using the import java.net.*; package to determine the name of the machine I'm using (I need it to set up a socket).

    Here is my code:

    Code:
    private static String GetHost () throws IOException {
    	
    		String MailHost;
    		MailHost = InetAddress.getHostName ();//.getLocalHost(). getHostAddress ();
    		return MailHost;
    		
    	}
    When this compiles I get a non-static context error. How can I fix this?

    Mach appreciated!
    "'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."

  2. #2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width