当前位置: 技术问答>java相关
救急!!!请帮我看看这段程序?为什么还是乱码?
来源: 互联网 发布时间:2014-12-30
本文导语: import java.io.*; import java.net.*; public class Pop3test { public static void main(String[] args) { try{ Socket s = new Socket(args[0],110); BufferedReader in = new BufferedReader(new InputStreamReader(s.get...
import java.io.*;
import java.net.*;
public class Pop3test
{
public static void main(String[] args)
{
try{
Socket s = new Socket(args[0],110);
BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
String str;
str = in.readLine();
System.out.println("初始化结果"+str);
out.write("USER wxyxln");
out.flush();
str = in.readLine();
System.out.println("用户名输入结果 "+str);
out.write("pass wxyxl78n");
out.flush();
str = in.readLine();
System.out.println("密码输入结果 "+str);
out.write("listn");
out.flush();
str = in.readLine();
System.out.println("List "+str);
int i=0;
while((str = in.readLine()) != null)
{
System.out.println(str);
if (!(str.equals(".")))
{
i++;
}
else
break;
}
System.out.println("共有 "+i+" 封邮件");
String result = "";
byte[] b;
for (int j=1;j'9'?ch1-'A'+10:ch1-'0')*16+
(ch2>'9'?ch2-'A'+10:ch2-'0');
putchar(hz);
}
else putchar(ch);
}
fclose(fp);
}
import java.net.*;
public class Pop3test
{
public static void main(String[] args)
{
try{
Socket s = new Socket(args[0],110);
BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
String str;
str = in.readLine();
System.out.println("初始化结果"+str);
out.write("USER wxyxln");
out.flush();
str = in.readLine();
System.out.println("用户名输入结果 "+str);
out.write("pass wxyxl78n");
out.flush();
str = in.readLine();
System.out.println("密码输入结果 "+str);
out.write("listn");
out.flush();
str = in.readLine();
System.out.println("List "+str);
int i=0;
while((str = in.readLine()) != null)
{
System.out.println(str);
if (!(str.equals(".")))
{
i++;
}
else
break;
}
System.out.println("共有 "+i+" 封邮件");
String result = "";
byte[] b;
for (int j=1;j'9'?ch1-'A'+10:ch1-'0')*16+
(ch2>'9'?ch2-'A'+10:ch2-'0');
putchar(hz);
}
else putchar(ch);
}
fclose(fp);
}
|
email里明明有这么一行:
Content-Transfer-Encoding: quoted-printable
编码方式就是quoted-printable,一个等号后面跟ASCII码,就这么简单。
Content-Transfer-Encoding: quoted-printable
编码方式就是quoted-printable,一个等号后面跟ASCII码,就这么简单。