´úÂëת»»£¬½«java´úÂëת»»³ÉC#´úÂ룬¸ßÊÖ°ïæ
Java code:
URL url = new URL("http://www.baidu.com");
URLConnection connection = (HttpURLConnection)url.openConnection();
connection.setRequestProperty( " User-agent " , " IE/7.0 " );
connection.connect();
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream(),"Shift_JIS"));//¸ù¾Ý¶ÔÓ¦±àÂë½ÓÊÕ
String line = null ;
StringBuilder sb = new StringBuilder();
while ((line = in.readLine()) != null ) {
sb.append(line);
}
in.close();
String trans=sb.toString();
System.out.print(trans);
C# code:
System.Net.WebClient client = new System.Net.WebClient();
client.Headers.Add("user-agent", " IE/7.0 ");
Stream data = client.OpenRead("http://www.baidu.com");
StreamReader reader = new StreamReader(data,Encoding.Default);
string s = reader.ReadToEnd();
data.Close();
reader.Close();
//Response.Write(s);
Ïà¹ØÎÊ´ð£º
¹¤×÷ÐèÒª Çó´ó¼Ò°ïæд¸ö³ÌÐò
ÎÒÊÇѧC++µÄ ²»¶®JAVA
±àдһ¸öJavaÓ¦ÓóÌÐò£¬¶ÔÓÚ¸ø¶¨µÄÒ»¸ö×Ö·û´®µÄ¼¯ºÏ£¬¸ñʽÈ磺
{aaa bbb ccc}£¬ {bbb ddd}£¬{eee fff}£¬{ggg}£¬{ddd hhh}
ÒªÇ󽫯äÖн»¼¯²»Îª¿ÕµÄ ......
<html><head><title>[@title]</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<script language='javascript'>
function diyCheck ......
JSPÒ³ÃæÖÐÓжà¸öradio°´Å¥
JSPÒ³Ãæ½«²ÎÊýPOST¸øservlet
ÒªÇóÈçÏÂ;
1.Ñ¡ÔñÒ»¸öradio£¬µ÷ÓÃservlet servletÖиù¾Ý²ÎÊýµ÷ÓÃÆäËû½Ó¿Ú£¬³ý·ÇÑ¡ÖиÃradio²¢µã»÷JSPÖеÄʵР......
ÎÒJSPµÄÒ³ÃæÊÇ£º
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......
<?xml version="1.0" encoding="utf-8" ?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical&q ......