ASP.NETÈçºÎ·¢ËÍHTTPÇëÇó
ÈÃÒ»´®×Ö·û´®²ÎÊýҪͨ¹ý ¶Ô·½¸øÄãµÄµØÖ· ʹÓÃPOST·½Ê½´«µÝµ½¶Ô·½ÄÇÀȻºó¶Ô·½»á·µ»Ø¸øÄãXMLÄÚÈÝ£¬È»ºóÐèÒª´ÓÕâ¸öXMLÖлñÈ¡Ïà¹Ø½ÚµãµÄÖµ¡£
Õû¸ö¹ý³Ì¶ÔÎÒ¶øÑÔÏ൱ÄÑ¡£ÒòΪÒÔǰ´ÓÀ´Ã»Óùý¡¢ ÓÐûÈË·¢¸ö²Î¿¼£¬»òÕß´úÂëʾÀý¡¢
×Ô¼ºÑо¿°É£º
http://msdn.microsoft.com/en-us/library/debx8sh9.aspx
µ÷ÓÃweb services·µ»ØXMLÄÚÈÝ
C# code:
/// <summary>
/// Get Content of one page by Post Mothod
/// </summary>
/// <param name="url">address of page</param>
/// <param name="encoding">encode or charset</param>
/// <returns>the content of page</returns>
public static string Post(string url, string accept, string contentType, string referer, string language,string postContent, CookieContainer cc, Encoding encoding, out string returnUrl) {
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
req.CookieContainer = cc;
req.Accept = accept;
req.ContentType = contentType;
req.Referer = referer;
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506; .NET CLR 3.5.21022)";
if (!string.IsNullOrEmpty(language)) {
Ïà¹ØÎÊ´ð£º
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.WebControls
Namespace CBDAspNet.WebControls.HTML
''' <summary>
'' ......
Êý¾Ý¿â±íÖÐÓÐÒ»ÁУ¨TranXml£©ÀàÐÍÊÇxml£¬´æ´¢µÄÊÇÀàËÆ
<fathernode>
<a>aaa
</a>
<b>bbb
</b>
</fathernode>
µÄÐÅÏ¢£¬²¢ÇÒͨ¹ý²éѯ·½· ......
µ÷ÕûÁËÕâÀÄÇÀï³öÎÊÌâ¡£
ÓÐûÓÐʲôºÃµÄ·½·¨£¬Ïñµ÷Õû¶Ô»°¿òÒ»Ñù£¿£¿£¿£¿
ÕÒ¸öרÃÅ×öÒ³ÃæµÄ
ÔÚdreamweaverÀïµ÷¡£¡£¡£Ò²¿ÉÒÔÖ±½Ó¿ØÖÆHTML´úÂë
ȷʵʹ¿à ¸ÐͬÉíÊÜѽ
¹þ¹þ ¼á¾ö·¹ý¡£
ÓÃDW°É£¬VS¸ãÉè¼Æ ......
protected void btnLogin_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Server = (local);user id = sa;pwd = 1;database = Login");
&nb ......