日期:2014-05-19  浏览次数:20847 次

怎样调用1个登陆页面而不用输入用户名和密码,在线等.....
怎样调用1个登陆页面而不用输入用户名和密码,不要告诉我在URL里面加入相关信息,我只知道在JAVA里面有软键盘,在C#中或ASP.NET中怎么做,恳请指点.

------解决方案--------------------
</HEAD>
</SCRIPT>
<BODY onload= "document.all.LoadForm.submit(); ">
<form id= "LoadForm " action= "http://mail.shodemy.com.cn/WorldClient.dll?View=Main " target= "_top " method= "post ">
<table align= "center " width= "490 " border= "0 " cellpadding= "0 " cellspacing= "0 " id= "loginTable ">
<tr>
<td align= "center ">
<table border= "0 " cellpadding= "0 " cellspacing= "8 ">
<tr align= "center ">
<td align= "left " valign= "top " class= "loginText "> <b> 邮件地址: </b> </td>
<td align= "left " valign= "top "> <input class= "loginInput " type= "text " name= "User " size= "18 " value= "我的登录名 " onfocus= "showFocus(this) " onblur= "showBlur(this) " /> </td>
</tr>
<tr align= "center ">
<td align= "left " valign= "top " class= "loginText "> <b> 密码: </b> </td>
<td align= "left " valign= "top "> <input value= "Ab1116 " class= "loginInput " type= "password " name= "密码 " autocomplete= "off " size= "18 " onfocus= "showFocus(this) " onblur= "showBlur(this) " /> </td>
</tr>
<tr>
<td> &nbsp; </td>
<td align= "left " valign= "top "> <input class= "loginButton " type= "submit " name= "Logon " value= "登录 " /> </td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</BODY>
</HTML>

------解决方案--------------------
使用post或get方式
------解决方案--------------------
post方式给你一个例子.
sUrl = http://job.spforum.net/login/Index.asp;
///////////////////////////////////
private CookieContainer cc = new CookieContainer();

/////////////////////
string postData = "uUsername=avoid&uPassword=123456 ";
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] data = encoding.GetBytes(postData);

request = (HttpWebRequest)WebRequest.Create(sUrl);
request.Method = "POST ";
request.ContentType = "application/x-www-form-urlencoded ";
request.ContentLength = data.Length;
Stream newStream = request.GetRequestStream();
newStream.Write(data, 0, data.Length);

newStream.Close();

request.CookieContainer = cc;

response = (HttpWebResponse)request.GetResponse();
cc.Add(response.Cookies);
stream = response.GetResponseStream();
sHtml = new StreamReader(stream, System.Text.Encoding.Default).ReadToEnd();

------解决方案--------------------