SORU
8 ŞUBAT 2011, Salı


XmlDocument - dize gelen yük?

protected void Page_Load(object sender, EventArgs e)
{
    XmlDocument doc = new XmlDocument();
    try
    {
        string path = Server.MapPath(".");
        doc.Load(path "whatever.xml");
    }
    catch (Exception ex)
    {
        lblError.Text = ex.ToString();
        return;
    }

    // Convert XML to a JSON string
    string JSON = XmlToJSON(doc);

    // Replace \ with \\ because string is being decoded twice
    JSON = JSON.Replace(@"\", @"\\");

    // Insert code to process JSON at end of page
    ClientScriptManager cs = Page.ClientScript;
    cs.RegisterStartupScript(GetType(), "SpaceJSON", "space_processJSON('"   JSON   "');", true);
}

Bir dosyadan xml yükleme yerine, nasıl bir dize gelen yük?

CEVAP
8 ŞUBAT 2011, Salı


XmlDocument doc = new XmlDocument();
doc.LoadXml(str);

str XML dizesi. Daha fazla bilgi için MSDN article bkz.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Elliot Davin

    Elliot Davin

    28 Kasım 2008
  • ExcelIsFun

    ExcelIsFun

    16 ŞUBAT 2008
  • theKGB65

    theKGB65

    24 Aralık 2007