Posts

Showing posts from November, 2011

Donate

How To Decode An Encoded URL In C#.NET

The code below illustrates how to decode an encoded url using HttpUtility.UrlDecode(string url) using System.Web; //make sure to add reference to System.Web string temp_url = "http%3a%2f%2fplacement.emploiquebec.net%2f" + "mbe%2fut%2fsuivroffrs%2fapercoffr.asp" + "%3fnooffr%3d3053675%26page%3drech%26prov% 3derechroffr%252Easp%26CL%3denglish "; string url = HttpUtility.UrlDecode(temp_url);

Read Or Parse XML Using XmlElement Class, XPath And XmlNodelist In C#

Sample xml file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <?xml version="1.0" encoding="UTF-8"?> <jobs> <job> <title> Payroll Analyst </title> <description> <summary> Seeking Payroll Analyst specialists. Great benefits and competitive salary. Must meet all requirements to be considered for assignment. </summary> </description> <location> <state> Pennsylvenia </state> </location> </job> <job /> </jobs> Code: 1 2 3 4 5 6 7 8 9 10 11 ListingSource = webclient.DownloadString( "your_xmlurl" ); StringReader readString = new System.IOStringReader(ListingSource); XmlDocument awesome = new XmlDocument(); awesome.Load(readString); XmlNodeList nodeList = awesome.SelectNodes( "//jobs/job" ); foreach (XmlElement element in nodeList) { title = elem

Donate