⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dnsclient.java.bak

📁 DNS Client和SMTP Client
💻 BAK
字号:
import java.net.*;
import java.io.*;

public class DNSClient {

 // Input a string
 public static String readLine()
  throws IOException {
  BufferedReader br = 
   new BufferedReader(new InputStreamReader(System.in));
  return br.readLine();
 }

 // Prompt for and input a string
 public static String readLine(String prompt)
  throws IOException {
  System.out.print(prompt);
  return readLine();
 }

 // Main program
 public static void main(String args[])
  throws IOException {
  System.out.println("Enter strings when prompted(本程序实现域名与IP之间的转化).");
  System.out.print("Enter internet Host name: ");
  String s1 = readLine();
  try{InetAddress address=InetAddress.getByName(s1);
  System.out.println(address.toString());
  }
  catch(UnknownHostException e)
	 {System.out.println("无法找到"+s1);}
//  String s2 = readLine("Enter your last name: ");
  //System.out.println("Your name: " + s1 + " " + s2);
 }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -