Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
try
{
WebClient client = new WebClient();
client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
using(Stream data = client.OpenRead(fileURL))
{
int offset = 0;
byte[] buffer = new byte[1000];
int size;
using(FileStream fileStream = new FileStream(fileLocation, FileMode.Create, FileAccess.Write))
{
int count = buffer.Length;
do
{
size = data.Read(buffer, offset, count);
fileStream.Write(buffer, offset, size);
} while (size > 0);
fileStream.Flush();
}
}
return true;
}
catch (Exception ex)
{
string errorMessage = ex.Message;
return false;
}