UtilWebDownloadWebpage(String, WebProxy, Encoding, KeyValuePairString, String) Method
Downloads the source-code of an Url that points to an Html document.
Namespace: DevCase.Core.Networking.CommonAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static string DownloadWebpage(
string url,
WebProxy proxy,
Encoding enc,
params KeyValuePair<string, string>[] additionalHeaders
)
Public Shared Function DownloadWebpage (
url As String,
proxy As WebProxy,
enc As Encoding,
ParamArray additionalHeaders As KeyValuePair(Of String, String)()
) As String
Dim url As String
Dim proxy As WebProxy
Dim enc As Encoding
Dim additionalHeaders As KeyValuePair(Of String, String)()
Dim returnValue As String
returnValue = UtilWeb.DownloadWebpage(url,
proxy, enc, additionalHeaders)
public:
static String^ DownloadWebpage(
String^ url,
WebProxy^ proxy,
Encoding^ enc,
... array<KeyValuePair<String^, String^>>^ additionalHeaders
)
static member DownloadWebpage :
url : string *
proxy : WebProxy *
enc : Encoding *
additionalHeaders : KeyValuePair<string, string>[] -> string
No code example is currently available or this language may not be supported.
- url String
-
The Url address.
- proxy WebProxy
-
The proxy to use.
- enc Encoding
-
The Encoding used to read the webpage.
- additionalHeaders KeyValuePairString, String
-
Specifies custom headers to perform the web request.
String
The resulting source-code.
This is a code example.
No code example is currently available or this language may not be supported.
Dim proxy As New WebProxy(Host:="myproxy address", Port:=800)
proxy.Credentials = New NetworkCredential("user", "pass")
Dim html As String = DownloadWebpage("http://www.elhacker.net/", proxy, Encoding.UTF8, New KeyValuePair(Of String, String)("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"))
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.