yep, that solves the issue. thanks Camilo.
string id = xmlattrc[0].Value;
Hi,
Try changing xmlttrc.[x].Value for xmlttcr[0].Value
Hint - Whenever you get an exception copi the output an pasted in your question.
Camilo
yep, that solves the issue. thanks Camilo.
string id = xmlattrc[0].Value;
Hi,
Try changing xmlttrc.[x].Value for xmlttcr[0].Value
Hint - Whenever you get an exception copi the output an pasted in your question.
Camilo
my xml is somehting like this:
<loc id="123">
<value>data1</value>
</loc>
<loc id="223">
<value>data2</value>
</loc>
<loc id="323">
<value>data3</value>
</loc>
<loc id="423">
<value>data4</value>
</loc>
how do I read all the ids?
this code give me only the first id (123). when it loops to next, throws exception.
XmlNodeList xmlnode = xmldoc.GetElementsByTagName("loc");
for (int x = 0; x < xmlnode.Count; x++)
{
XmlAttributeCollection xmlattrc = xmlnode[x].Attributes;
string id = xmlattrc[x].Value;
}
my string looks like this,
<place id="opt1"><data>data 1-data2 ! data3</data></place>
I'd like to remove space, -, ! from only data element (data 1-data2 ! data3) using regex. Rest of stuff should be as it is (<place id="opt1"><data></data></place>). Any idea?
I have only one select drop down in my response text. Can you tell me with some code, how to get option value using regular expression. Thanks.
There is a drop-down (html select list) in the html source. I want to fetch all the values within that select box (option items). I don't want to use forms. This is console app. Please adivce.
<select name="listnames" id="listnames">
<option value="190">my data 1</option>
<option value="1930">my data 2</option>
...............................
</select>
I am new to C#. I have been working on a C# console project. I sent a request to a server and get a very lengthy response string (html format). I want to extract and get some information from this string. If I use javascript I know how to fetch. This is console project. How do I extract it? Thanks.