Note that there are some explanatory texts on larger screens.

plurals
  1. POsaving webbrowser url to xml and retriving
    primarykey
    data
    text
    <p>I am trying to save my webbrowser controler URL to a xml file but I am getting an issue with certain characters preventing the save.</p> <p>When I open a simple URL like this:</p> <p><code>www.saypeople.com</code></p> <p>It succesfully saves, however when I want to save webpage url like this:</p> <p><code>http://scholar.google.com.pk/scholar?as_q=filetype:pdf +transistor+ AND&amp;num=10&amp;btnG=Search+Scholar&amp;as_epq=&amp;as_oq=unknown+unclear&amp;as_eq=&amp;as_occt=any&amp;as_sauthors=+ &amp;as_publication=+ &amp;as_ylo=&amp;as_yhi=&amp;as_sdt=1.&amp;as_sdtp=on&amp;as_sdtf=&amp;as_sdts=5&amp;hl=en</code></p> <p>The save fails.</p> <p>I have checked a lot things and have discovered that my code only does not save when the url contains any of the two characters <code>&amp;&lt;</code>.</p> <p>Please help me out.</p> <p>Here is my code...</p> <pre><code> public static DialogResult Show(string Title, String url) { MsgBox = new addfav(); MsgBox.textBox1.Text = Title; MsgBox.textBox2.Text = url; MsgBox.ShowDialog(); return result; } const string dataxml = "data.xml"; private void button1_Click(object sender, EventArgs e) { //textBox2.Text containing webpage url //textBox1.Text containing webpage title try { XmlTextReader reader = new XmlTextReader(dataxml); XmlDocument doc = new XmlDocument(); doc.Load(reader); reader.Close(); XmlNode currNode; XmlDocumentFragment docFrag = doc.CreateDocumentFragment(); docFrag.InnerXml = "&lt;fav&gt;" + "&lt;Title&gt;" + textBox1.Text + "&lt;/Title&gt;" + "&lt;url&gt;"+ textBox2.Text + "&lt;/url&gt;" + "&lt;/fav&gt;"; // insert the availability node into the document currNode = doc.DocumentElement; currNode.InsertAfter(docFrag, currNode.LastChild); //save the output to a file doc.Save(dataxml); this.DialogResult = DialogResult.OK; MessageBox.Show("Sucessfully Added"); } catch (Exception ex) { Console.WriteLine("Exception: {0}", ex.ToString()); this.DialogResult = DialogResult.Cancel; } MsgBox.Close(); } </code></pre> <p>and how can i retrive url by searching specific title in xml.</p> <pre><code>&lt;fav&gt; &lt;Title&gt;hello&lt;/Title&gt; &lt;url&gt;&lt;![CDATA[http://scholar.google.com.pk/scholar?as_q=filetype:pdf +hello+ AND&amp;num=10&amp;btnG=Search+Scholar&amp;as_epq=&amp;as_oq=unknown+unclear&amp;as_eq=&amp;as_occt=any&amp;as_sauthors=+ &amp;as_publication=+ &amp;as_ylo=&amp;as_yhi=&amp;as_sdt=1.&amp;as_sdtp=on&amp;as_sdtf=&amp;as_sdts=5&amp;hl=en]]&gt;&lt;/url&gt; &lt;/fav&gt; &lt;fav&gt; &lt;Title&gt;toad&lt;/Title&gt; &lt;url&gt;&lt;![CDATA[http://www.sciencedaily.com/search/?keyword=toad+ AND unknown OR unclear]]&gt;&lt;/url&gt; &lt;/fav&gt; </code></pre> <p>i want to search and save the url of toad title in string... please help me out... thx </p>
    singulars
    1. This table or related slice is empty.
    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.
 

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