[ Microsoft.com ] – XPath Examples

XPath Examples

    XPath Examples
    ………………………………………………………………………………………………………………….
    This topic reviews the syntax examples that appear throughout the XPath Reference. All are based on the Sample XML File
    for XPath Syntax (inventory.xml).  For an example of using an XPath expression in a test file, see “Example of Unions ( | )”,
    at the bottom of this topic.

Continue reading

[ StackOverflow.com ] – how to post data to specific URL using WebClient in C#

how to post data to specific URL using WebClient in C# – Stack Overflow

string URI =http://www.myurl.com/post.php”;
string myParameters =“param1=value1&param2=value2&param3=value3”;

using (WebClient wc =newWebClient())
{
      wc
.Headers[HttpRequestHeader.ContentType]=“application/x-www-form-urlencoded”;
     
stringHtmlResult= wc.UploadString(URI, myParameters);
}

[ StackOverflow.com ] Cannot set some HTTP headers when using System.Net.WebRequest

c# – Cannot set some HTTP headers when using System.Net.WebRequest – Stack Overflow

When I try to add a HTTP header key/value pair on a WebRequest object, I get the following exception:

This header must be modified using the appropriate property

I’ve tried adding new values to the Headers collection by using the Add() method but I still get the same exception… Continue reading