Donate

Posting Data To WebBrowser Control In C#

Good day!

Basically, it is possible to post data to web browser control using C#. The code below, was referenced from MSDN, but i slightly modified some of it's functionalities.
string url = "http://example.com";  
string postData = String.Format("city=DC&Page={0:00}",pageNum);  
byte[] Post = Encoding.UTF8.GetBytes(postData );  
string AdditionalHeaders = "Content-Type: application/x-www-form-urlencoded";  
//wbSample is the web browser control  
//the WebNavigate method is just a simple method i created  
//which simply assigns url to the browser, the post data and additional headers  
WebNavigate(wbSample , ListURL, "", Post, AdditionalHeaders);

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.

Invalid nested tag div found, expected closing tag input