Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>public partial class XMLWriter : System.Web.UI.Page { static string strFileName=@"E:\vijay112.xml"; static XmlTextWriter write = null; public static int i = 0; ////// static string ProcessName=Process.GetCurrentProcess().ProcessName; //////static Process[] processes = Process.GetProcessesByName(ProcessName); ////// if ( // { ////// // Application.ExitThread(); ////// // } public XMLWriter() { } ~XMLWriter() { //write.Close(); ; } protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) write = new XmlTextWriter(strFileName, null); div_div.InnerText = i.ToString(); } catch (Exception ex) { } } public static string XMLWrite() { try { if (i == 0) return "success"; else { return "please end the"+i+"more child"; } } catch (Exception ex) { return ex.Message; } finally { try { } catch ( Exception ex){} } } public static void SetRootElement(string strRootElement) { write.WriteStartElement(strRootElement); } //public static void SetAttributeString(string strRootElement) //{ // write.WriteString(); //} public static void SetChildElement(string strChildElement) { write.WriteStartElement(strChildElement); } public static void SetAttribute(string strAttribute, string strValue) { write.WriteAttributeString(strAttribute, strValue); } public static void EndChildElement() { write.WriteEndElement(); } public static void EndRootElement() { write.WriteFullEndElement(); } protected void Bt_root_Click(object sender, EventArgs e) { SetRootElement(TB_key.Text); } protected void bt_child_Click(object sender, EventArgs e) { ++i; SetChildElement(TB_key.Text); } protected void BT_attribute_Click(object sender, EventArgs e) { SetAttribute(TB_key.Text, TB_value.Text); } protected void bt_endChild_Click(object sender, EventArgs e) { --i; EndChildElement(); } protected void bt_endroot_Click(object sender, EventArgs e) { EndRootElement(); } protected void bt_xml_Click(object sender, EventArgs e) { write.Close(); XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(@"E:\vijay\SourceCodeBackEnd\PrimeroWebService\Images\vijay112.xml"); // write.Flush(); Txml.Text= xmldoc.InnerXml; } protected void Txml_TextChanged(object sender, EventArgs e) { } protected void bt_close_Click(object sender, EventArgs e) { } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload