xml post(C#)
xmlpost by HttpWebRequest:
protected string PostXmlToURL(string url,string data)
{
HttpWebRequest hwr = (HttpWebRequest)HttpWebRequest.Create(url);
hwr.Method = "POST";
Stream stream = hwr.GetRequestStream();
StreamWriter sw = new StreamWriter(stream, System.Text.Encoding.UTF8);
sw.Write(data);
sw.Close();
stream = hwr.GetResponse().GetResponseStream();
StreamReader sr = new StreamReader(stream);
string result = sr.ReadToEnd();
sr.Close();
return result;
}
xmlpost by XMLHTTP:
·¢ËÍÇëÇó.
StreamReader sr=new StreamReader(Server.MapPath(XMLPathFull));
MSXML2.XMLHTTPClass xmlHttp = new MSXML2.XMLHTTPClass();
xmlHttp.open("post",strURL,false,"","");
xmlHttp.setRequestHeader ("Content-type","text/xml;charset=UTF-8");
xmlHttp.send(sr.ReadToEnd());
//µÃµ½response
string backxmlstring=xmlHttp.responseText.ToString();
½â¶ÁÏìÓ¦.
byte[] buf = Request.BinaryRead(Request.ContentLength);
string str = System.Text.Encoding.UTF8.GetString(buf);
xmlpost by js:
<script language="javascript" type="text/javascript">
function PostXml(url, data) {
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlhttp.Open("POST", url, false);
xmlhttp.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.SetRequestHeader("Content-Length", d
Ïà¹ØÎĵµ£º
ÔÚasp.net開發ÖУ¬經³£會Óõ½áą́ºÍǰ̨µÄ½»»¥£¬¾Í´Ë總結ÁËÒ»點c#ºÍjavascriptÏ໥²Ù×÷µÄ·½·¨
¡¡¡¡1.ÔÚáą́c#´ú碼ÖÐ調ÓÃjacascriptµÄ·½·¨
¡¡¡¡javascript´ú碼£º
¡¡¡¡<script type="text/javascript" language="javascript">
¡¡¡¡function test()
¡ ......
ÎÄÕÂÀ´Ô´£ºIT¹¤³Ì¼¼ÊõÍø http://www.systhinker.com/html/43/n-11643.html
ÓõÄÊÇÒ»Öֺܱ¿µÄ·½·¨£¬µ«¿ÉÒÔ°ïÖú³õѧÕßÁ˽â·ÃÎÊXML½ÚµãµÄ¹ý³Ì¡£
ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏÂ:
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
......
2010-05-19
Æß¡¢×ª»»XML
l ¿ÉÀ©Õ¹Ñùʽ±íÓïÑÔ£¨XSL£©£¬±»¶¨Òå³ÉÁËÒ»ÖÖ±íʾÑùʽ±íµÄÓïÑÔ¡£ÊǹÜÀíÔõÑù´Ó¸ñʽAת»»Ò»¸öÎĵµµ½¸ñʽBµÄ¹æ·¶ÓïÑÔ¡£¸ÃÓïÑÔ×é¼þÓÃÓÚ¹ÜÀíת»»½á¹¹ÖеĴ¦ÀíºÍÉí·ÝÑéÖ¤
n XSLÊÇÒ»ÖÖÓÃÀ´×ª»»XMLÎĵµµÄÓïÑÔ¡£
n XSLÊÇÒ»¸öÓÃÀ´Ö¸¶¨XMLÎĵµ¸ñʽµÄ´Ê»ã¿â¡£
l XSLºÍÊ÷ÐÎÃèÊö£ºÕâ ......
/// <summary>
/// ¸ù¾ÝÖ¸¶¨²ÎÊý·µ»ØBitMap¶ÔÏó
/// ÒýÓÃÈçÏ£º
/// using System.Drawing;
/// µ÷ÓÃÀý×ÓÈçÏ£º
......