Nageshwar Rao

Nageshwar Rao

  • NA
  • 74
  • 34.9k

How to add image from c#

Sep 1 2016 6:42 AM
Hi 
 
How can i add image using c#
static void Main(string[] args)
{
try
{
String uriString = "http://******;
WebClient myWebClient = new WebClient();
string fileName = @"C:\Pictures\phone-icon.png";
Stream objStrm = myWebClient.OpenRead(fileName);
objStrm.Position = 0;
myWebClient.UploadFile(new Uri(uriString), "POST", objStrm.ToString());
Console.WriteLine("completed");
Console.Read();
}
catch (Exception ex)
{
Console.WriteLine("error");
}
 
 
but it is not working,image is not uploading at my destination 
 

Answers (2)