download file from url asp net web api c#
var client = new HttpClient();
var response = await client.GetAsync(@"http://localhost:9000/api/file/GetFile?filename=myPackage.zip");
using (var stream = await response.Content.ReadAsStreamAsync())
{
var fileInfo = new FileInfo("myPackage.zip");
using (var fileStream = fileInfo.OpenWrite())
{
await stream.CopyToAsync(fileStream);
}
}
Also in C#:
- constructor in inherited class c#
- unity3d get component
- why is c# say ; expected
- how to reference scripts in other scenes unity
- c# yield
- c# find process by name
- unity html get request
- run async method parallel c#
- c# postfix increment operator overload
- O thread de chamada não pode aceder a este objecto porque existe outro thread que já o tem
- display none asp.net
- or in unity
- asp.net core allow all origins
- split using string c#
- what is using static in c#
- or symbol in unity
- datatable return column names
- how to detected WindowCloseEvent in other window wpf
- vector between two points unity
- create a file in the directory of the exe and write to it c#
- c# trim string
- unity print
- c# string to memorystream
- stateteach.net