30 lines
882 B
C#
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();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|