static void Main(string[] args) { try { string path = args[0]; Http web = new Http(); Http.UploadData upload = new Http.UploadData("files[]", path, File.ReadAllBytes(path)); Console.WriteLine("Uploading to epvpImg ..."); string result = web.GetUploadResponse("http://epvpimg.com/upload/", upload); result = result.Substring(result.IndexOf("alphaid")).Split('"')[2]; result = "http://i.epvpimg.com/" + result + Path.GetExtension(path); Clipboard.SetText(result); UpdateUploadLog(DateTime.Now.ToString("yyyy-MM-dd"),result); Console.WriteLine("Successfully uploaded to epvpImg!"); Application.Exit(); } catch(Exception ex) { Console.WriteLine(ex.Message); } }
private void uploadImage(object pPath) { string path = (string)pPath; Http web = new Http(); Http.UploadData upload = new Http.UploadData("files[]", path, File.ReadAllBytes(path)); string result = web.GetUploadResponse("http://epvpimg.com/upload/", upload); result = result.Substring(result.IndexOf("alphaid")).Split('"')[2]; setResult(result, path); }