So as you can see below I am downloading a file from VRChat’s website. Everything works when I use the full name of the file. However, their filenames change every time they update the file. For instance, the file name currently looks like this:
**“VRCSDK2-2021.04.21.11.58_Public.unitypackage”. **
If they update the file then the name change breaks my code. Is there a way to write my file name so that it will not break when they update? Such as a way to have the code look for any file starting with “VRCSDK2”?
Thanks for all the help!
private static string sdkStart = "https://files.vrchat.cloud/sdk/";
...
private static void DownloadSDK(string assetName)
{
GetPath();
WebClient w = new WebClient();
w.Headers.Set(HttpRequestHeader.UserAgent, "Webkit Gecko wHTTPS (Keep Alive 55)");
w.QueryString.Add("assetName", assetName);
w.DownloadFileCompleted += FileDownloadCompleted;
w.DownloadProgressChanged += FileDownloadProgress;
string url = sdkStart + assetName;
w.DownloadFileAsync(new Uri(url), Path + assetName);
}