This repository has been archived on 2017-12-27. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
ScreenCapture/Web.cs
2015-09-27 12:13:23 +02:00

30 lines
882 B
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace ScreenCapture
{
static class Web
{
public static async Task<string> upload(MemoryStream ms, string fileName)
{
using (HttpClient client = new HttpClient())
{
using (var content = new MultipartFormDataContent("------Upload" + DateTime.Now.Ticks))
{
content.Add(new StreamContent(ms), "file", fileName);
using (var message = await client.PostAsync("http://nyyu.tk/sc/api.php", content))
{
return await message.Content.ReadAsStringAsync();
}
}
}
}
}
}