久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  1. <i id='fcEpk'><tr id='fcEpk'><dt id='fcEpk'><q id='fcEpk'><span id='fcEpk'><b id='fcEpk'><form id='fcEpk'><ins id='fcEpk'></ins><ul id='fcEpk'></ul><sub id='fcEpk'></sub></form><legend id='fcEpk'></legend><bdo id='fcEpk'><pre id='fcEpk'><center id='fcEpk'></center></pre></bdo></b><th id='fcEpk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fcEpk'><tfoot id='fcEpk'></tfoot><dl id='fcEpk'><fieldset id='fcEpk'></fieldset></dl></div>
    1. <tfoot id='fcEpk'></tfoot>
        <bdo id='fcEpk'></bdo><ul id='fcEpk'></ul>
    2. <legend id='fcEpk'><style id='fcEpk'><dir id='fcEpk'><q id='fcEpk'></q></dir></style></legend>

      <small id='fcEpk'></small><noframes id='fcEpk'>

      從aspx網(wǎng)頁(yè)讀取xml

      Reading xml from aspx web page(從aspx網(wǎng)頁(yè)讀取xml)

          <tbody id='Nt7dC'></tbody>

          <bdo id='Nt7dC'></bdo><ul id='Nt7dC'></ul>
          • <small id='Nt7dC'></small><noframes id='Nt7dC'>

            1. <tfoot id='Nt7dC'></tfoot>
            2. <legend id='Nt7dC'><style id='Nt7dC'><dir id='Nt7dC'><q id='Nt7dC'></q></dir></style></legend>
              <i id='Nt7dC'><tr id='Nt7dC'><dt id='Nt7dC'><q id='Nt7dC'><span id='Nt7dC'><b id='Nt7dC'><form id='Nt7dC'><ins id='Nt7dC'></ins><ul id='Nt7dC'></ul><sub id='Nt7dC'></sub></form><legend id='Nt7dC'></legend><bdo id='Nt7dC'><pre id='Nt7dC'><center id='Nt7dC'></center></pre></bdo></b><th id='Nt7dC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Nt7dC'><tfoot id='Nt7dC'></tfoot><dl id='Nt7dC'><fieldset id='Nt7dC'></fieldset></dl></div>
                本文介紹了從aspx網(wǎng)頁(yè)讀取xml的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                限時(shí)送ChatGPT賬號(hào)..

                我們必須從一個(gè) aspx 頁(yè)面中讀取數(shù)據(jù).當(dāng)我們使用查詢字符串調(diào)用頁(yè)面時(shí),它會(huì)返回一個(gè) xml 文檔,其中包含與查詢字符串匹配的數(shù)據(jù).

                We have to read data from a aspx page. When we call the page with a query string, it returns an xml document with data that matches the query string.

                我們有一個(gè)與我們返回的 xml 匹配的 XSD.

                We have an XSD that matches the xml that we get back.

                我認(rèn)為我們可以從 http 響應(yīng)中讀取 xml 文檔.這行得通嗎?

                I am thinking that we can read the xml document out of the http response. Will this work?

                我們?nèi)绾?em>綁定 XML 與 XSD,以便我們可以將 XML 文檔視為強(qiáng)類型?

                How can we bind the XML with the XSD, such that we can treat the XML document as if it were strongly typed?

                謝謝,

                設(shè)拉子

                更新:

                找到這個(gè)關(guān)于如何反序列化的鏈接

                Found this link on how to deserialize

                在 C# 中將 XML 反序列化為對(duì)象

                推薦答案

                嗯,基本上,你可以請(qǐng)求一個(gè)類似這樣的 XML 文檔(這里沒(méi)有 try/catch - 但你絕對(duì)應(yīng)該添加它!):

                Well, basically, you can request an XML document something like this (no try/catch here - but you should definitely add that!):

                HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url);
                myRequest.Method = "POST";  // or GET - depends 
                
                myRequest.ContentType = "text/xml; encoding=utf-8";
                myRequest.ContentLength = data.Length;
                
                using (Stream reqStream = myRequest.GetRequestStream())
                {
                  // Send the data.
                  reqStream.Write(data, 0, data.Length);
                  reqStream.Close();
                }
                
                // Get Response
                WebResponse myResponse;
                
                myResponse = myRequest.GetResponse();
                XmlDocument _xmlDoc = new XmlDocument();
                
                using (Stream responseStream = myResponse.GetResponseStream())
                {
                   _xmlDoc.Load(responseStream);
                }   
                

                您有 GET 還是 POST 取決于您的場(chǎng)景 - 在 GET 中,您不會(huì)有請(qǐng)求數(shù)據(jù)輸出.

                Whether you have a GET or POST depends on your scenario - in a GET, you won't have request data going out.

                一旦您將 XML 作為 XmlDocument 恢復(fù),您可以根據(jù) XML 架構(gòu)對(duì)其進(jìn)行驗(yàn)證,或者只是嘗試將其反序列化為您擁有的 XSD 架構(gòu)所表示的類型.

                Once you have your XML back as a XmlDocument, you can either validate that against the XML schema, or just try to deserialize it into the type that is represented by the XSD schema you have.

                如果可行 --> 你得到的 XML 是有效的并且沒(méi)問(wèn)題.如果沒(méi)有,您將在反序列化時(shí)遇到異常.

                If that works --> the XML you got is valid and OK. If not, you'll get an exception on deserialization.

                馬克

                這篇關(guān)于從aspx網(wǎng)頁(yè)讀取xml的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                What are good algorithms for vehicle license plate detection?(車牌檢測(cè)有哪些好的算法?)
                onClick event for Image in Unity(Unity中圖像的onClick事件)
                Running Total C#(運(yùn)行總 C#)
                Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時(shí)刪除目錄)
                asp.net listview highlight row on click(asp.net listview 在單擊時(shí)突出顯示行)
                Calling A Button OnClick from a function(從函數(shù)調(diào)用按鈕 OnClick)

                  <tbody id='RLbrq'></tbody>
                <i id='RLbrq'><tr id='RLbrq'><dt id='RLbrq'><q id='RLbrq'><span id='RLbrq'><b id='RLbrq'><form id='RLbrq'><ins id='RLbrq'></ins><ul id='RLbrq'></ul><sub id='RLbrq'></sub></form><legend id='RLbrq'></legend><bdo id='RLbrq'><pre id='RLbrq'><center id='RLbrq'></center></pre></bdo></b><th id='RLbrq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='RLbrq'><tfoot id='RLbrq'></tfoot><dl id='RLbrq'><fieldset id='RLbrq'></fieldset></dl></div>

                  <small id='RLbrq'></small><noframes id='RLbrq'>

                      <bdo id='RLbrq'></bdo><ul id='RLbrq'></ul>
                      <legend id='RLbrq'><style id='RLbrq'><dir id='RLbrq'><q id='RLbrq'></q></dir></style></legend>

                      1. <tfoot id='RLbrq'></tfoot>

                        • 主站蜘蛛池模板: 水蜜桃一区二区 | 69精品视频 | 精品免费 | 久久免费看片 | 亚洲免费专区 | 成人精品免费视频 | 三级在线观看视频 | 天天射天天干天天操 | 色天使在线视频 | 1级黄色大片 | 51av视频 | 日韩av免费在线播放 | 精品国产一区二区三区久久久蜜月 | 国产一区二区三区在线看 | 午夜99| 精品一区二区三区免费 | 日韩城人免费 | 簧片在线免费观看 | 日本中文字幕在线视频 | 色综合久久天天综合网 | 国产精品自拍一区 | 黄色一级视频网站 | 亚洲国产精品成人无久久精品 | 欧美日韩国产成人 | 91亚洲国产| 天堂av影视 | 欧美黄视频 | 国内自拍偷拍视频 | 日本a v在线播放 | 精品国产99久久久久久宅男i | 久久久久久久影院 | 欧美成人综合 | 天天色小说 | 国产激情网站 | 天天草天天射 | 欧美偷拍视频 | 福利片在线 | 久久精品视频网 | 秋霞啪啪片 | av大全在线观看 | 久久精品中文 |