netstart -a | find "LISTENING"
Create A Bootable Usb Pendrive By Using Cmd Command Prompt
C:\WINDOWS\system32>diskpart
Microsoft DiskPart version 10.0.10586
Copyright (C) 1999-2013 Microsoft Corporation.
On computer: SARVESH-VAIO
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 465 GB 3072 KB
Disk 1 Online 7633 MB 0 B
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> create partition primary
DiskPart succeeded in creating the specified partition.
DISKPART> select partition 1
Partition 1 is now the selected partition.
DISKPART> active
DiskPart marked the current partition as active.
DISKPART> format fs=ntfs quick
100 percent completed
DiskPart successfully formatted the volume.
DISKPART> assign
DiskPart successfully assigned the drive letter or mount point.
DISKPART> exit
Leaving DiskPart...
C:\WINDOWS\system32>
Asynchronous HTTP request
-------------------------------------------
We can create asyn http web request
public static async Task<string> RequestAsync(string UrlReq, string requestxml)
{
WebRequest webRequest;
string Response = string.Empty;
try
{
var postData = requestxml;
var url = new Uri(UrlReq, UriKind.Absolute);
webRequest = WebRequest.Create(url);
webRequest.Method = "POST";
webRequest.ContentType = "text/xml";
webRequest.Timeout = 20000;
webRequest.Headers.Add("Accept-Encoding: gzip");
using (Stream postStream = await webRequest.GetRequestStreamAsync())
{
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
await postStream.WriteAsync(byteArray, 0, byteArray.Length);
await postStream.FlushAsync();
}
try
{
var response = (HttpWebResponse)await webRequest.GetResponseAsync();
Stream streamResponse = response.GetResponseStream();
if (response.Headers["Content-Encoding"].ToLower().Contains("gzip"))
{
streamResponse = new GZipStream(streamResponse, CompressionMode.Decompress);
}
using (StreamReader reader = new StreamReader(streamResponse))
{
Response = await reader.ReadToEndAsync();
}
response.Dispose();
streamResponse.Dispose();
if (Response == "")
{
return Response;
}
else
{
return Response;
}
}
catch (WebException Wex)
{
string WebError = new StreamReader(wex.Response.GetResponseStream()).ReadToEnd().ToString();
return WebError ;
}
}
catch (Exception ex)
{
return Response;
}
}
when getting error "The remote server returned an error: (500) Internal Server Error".
we get exact error in WebException
HttpWebResponse response = null;
try
{
response = (HttpWebResponse)request.GetResponse();
}
catch (WebException wex)
{
string WebError = new StreamReader(wex.Response.GetResponseStream()).ReadToEnd().ToString();
return WebError;
}
we get exact error in WebException
HttpWebResponse response = null;
try
{
response = (HttpWebResponse)request.GetResponse();
}
catch (WebException wex)
{
string WebError = new StreamReader(wex.Response.GetResponseStream()).ReadToEnd().ToString();
return WebError;
}