mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-24 23:16:51 +00:00
Ask for web auth if required
Ask for authentication to download private Khronos files.
This commit is contained in:
parent
d7c21bd3f5
commit
7427f44bbe
|
@ -49,7 +49,27 @@ namespace CHeaderToXML
|
||||||
using (var wb = new WebClient())
|
using (var wb = new WebClient())
|
||||||
{
|
{
|
||||||
string filename = Path.Combine(Path.GetTempPath(), Path.GetTempFileName());
|
string filename = Path.Combine(Path.GetTempPath(), Path.GetTempFileName());
|
||||||
wb.DownloadFile(path, filename);
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
wb.DownloadFile(path, filename);
|
||||||
|
}
|
||||||
|
catch (WebException e)
|
||||||
|
{
|
||||||
|
if (e.Message == "The remote server returned an error: (401) Unauthorized.")
|
||||||
|
{
|
||||||
|
System.Console.WriteLine(e.Message);
|
||||||
|
System.Console.Write("Username: ");
|
||||||
|
string username = System.Console.ReadLine();
|
||||||
|
System.Console.Write("Password: ");
|
||||||
|
string password = System.Console.ReadLine();
|
||||||
|
|
||||||
|
wb.UseDefaultCredentials = true;
|
||||||
|
wb.Credentials = new NetworkCredential(username, password);
|
||||||
|
wb.DownloadFile(path, filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
contents = File.ReadAllLines(filename);
|
contents = File.ReadAllLines(filename);
|
||||||
File.Delete(filename);
|
File.Delete(filename);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue