daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Mar 31st, 2014 186 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. namespace ManualTesting
  2. {
  3.     using System.Collections.Generic;
  4.     using System.IO;
  5.     using System.Net;
  6.  
  7.     internal static class ManualTesting
  8.     {
  9.         private static void Main()
  10.         {
  11.             Dictionary<string, object> dictionary = new Dictionary<string, object>
  12.             {
  13.                 {
  14.                     "fileKey1", new FileParameter(File.ReadAllBytes(@"C:\file1.jpg"), "file1.jpg", "image/jpeg")
  15.                 },
  16.                 {
  17.                     "fileKey2", new FileParameter(File.ReadAllBytes(@"C:\file2.jpg"), "file2.jpg", "image/jpeg")
  18.                 },
  19.                 {
  20.                     "fileKey3", new FileParameter(File.ReadAllBytes(@"C:\file3.jpg"), "file3.jpg", "image/jpeg")
  21.                 },
  22.                 {
  23.                     "stringKey", "stringValue"
  24.                 }
  25.             };
  26.  
  27.             const string userAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36 OPR/20.0.1387.82";
  28.  
  29.             HttpWebResponse response = MultipartFormDataPost("http://example.com/post.aspx", userAgent, dictionary);
  30.         }
  31.     }
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top