ʹÓÃWebClient×Ô¶¯Ìîд²¢Ìá½»ASP.NETÒ³Ãæ±íµ¥
ʹÓÃWebClient×Ô¶¯Ìîд²¢Ìá½»ASP.NETÒ³Ãæ±íµ¥
ÔÚ.NETÖÐͨ¹ý³ÌÐòÌîдºÍÌá½»±íµ¥»¹ÊDZȽϼòµ¥¡£±ÈÈ磬ҪÌá½»Ò»¸öÈçÏÂͼËùʾµÄµÇ¼±íµ¥£º
ÌîдºÍÌá½»ÒÔÉÏ±íµ¥µÄ´úÂëÈçÏ£º
// ÒªÌá½»±íµ¥µÄURI×Ö·û´®¡£
string uriString = "http://www.xxx.com/Login.aspx";
// ÒªÌá½»µÄ×Ö·û´®Êý¾Ý¡£
string postString = "userName=user1&password=password1";
// ³õʼ»¯WebClient
WebClient webClient = new WebClient();
webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
// ½«×Ö·û´®×ª»»³É×Ö½ÚÊý×é
byte[] postData = Encoding.ASCII.GetBytes(postString);
// ÉÏ´«Êý¾Ý£¬·µ»ØÒ³ÃæµÄ×Ö½ÚÊý×é
byte[] responseData = webClient.UploadData(uriString, "POST", postData);
// ·µ»ØµÄ½«×Ö½ÚÊý×éת»»³É×Ö·û´®(HTML)
string srcString = Encoding.UTF8.GetString(responseData);
srcStrinig ¾ÍÊÇÌá½»±íµ¥ºóËù·µ»ØÒ³ÃæµÄHTML¡£ÔõôÑù£¬ºÜ¼òµ¥°É¡£
µ«ÊÇ£¬ÒÔÉÏ´úÂë¿ÉÒÔÌá½»ASP»òJSPÉú³ÉµÄ±íµ¥£¬È´²»ÄÜÌá½»ASP.NET±íµ¥¡£ÒòΪÌá½»ASP.NET±íµ¥Ê±£¬±ØÐë¸ø“__VIEWSTATE”ºÍ“__EVENTVALIDATION”¸³Öµ¡£“__VIEWSTATE”ºÍ“__EVENTVALIDATION”µÄÖµ¿ÉÒÔͨ¹ýÔÚÒªÌá½»µÄÒ³ÃæÉÏ°´ÓÒ¼ü“²é¿´Ô´Îļþ”ÖÐÕÒµ½¡£ÈçÏ£º
id="__VIEWSTATE" value="/wEPDwUKM
Ïà¹ØÎĵµ£º
΢ÈíÒѾÐû²¼ASP.NET MVC 2µÄ´úÂëÒÔMS-PLÐÒé·¢²¼,MS-PLÊÇÒ»¸öµÃµ½OSIÈÏÖ¤µÄ¿ªÔ´ÐÒ飬ASP.NET MVC»ùÓÚMS-PL·¢²¼£¬ÊÇÒ»¸öÕæÕýµÄ¿ªÔ´¿ò¼ÜÇÒûÓÐÈκÎƽ̨ÏÞÖÆ£¬Ò²¾ÍÊÇ˵£¬Äú¿ÉÒÔÔÚmonoÏÂʹÓûò¿ª·¢ASP.NET MVCµÄÏà¹ØÏîÄ¿¡£ ¿ÉÒÔµ½ASP.NET MVC 2 RTM Download Details page»ñÈ¡Ô´´úÂë,»òÕßµ½CodePlexÉÏ»ñÈ¡£¬Õâ¸öÒ³ÃæÊÇ΢Èí¹Ù ......
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;namespace md5
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(UserMd5("8"));
Console.WriteLine(GetMd5Str("8"));
}
/**//// <summary>
/// MD5 16λ¼ÓÃÜ
......
1.//µ¯³ö¶Ô»°¿ò.µã»÷תÏòÖ¸¶¨Ò³Ãæ
Response.Write(" <script>window.alert('¸Ã»áԱûÓÐÌá½»ÉêÇë,ÇëÖØÐÂÌá½»£¡')
</script>");
Response.Write(" <script>window.location
='http://www.51aspx.com/bizpulic/upmeb.aspx' </script>");
2.//µ¯³ö¶Ô»°¿ ......
Beyond File | New Company: from Cheesy Sample to Social Platform Scott Hanselman in Lagoon L on Monday at 11:30 AM The web has changed and there's a new way of thinking about your applications. You can't just write some HTML and CSS anymore and expect to be the next Twitter. Hear h ......
×î½üÔÚ¿´¡¶asp.netͨÓÃÄ£¿é¼°µäÐÍϵͳ¿ª·¢ÊµÀýµ¼º½¡·£¬ÆäÖÐÓõ½ÁËMD5¼ÓÃÜ£¬´úÂëÈçÏ£º /// <summary>
/// ×Ö·û´®¼ÓÃܺ¯Êý
/// </summary>
/// <param name="strInput">ÊäÈë±»¼ÓÃܵÄ×Ö·û´®</param>
/// <returns>¼ÓÃܺóµÄ×Ö·û´®</return ......