Hello,
Based on your error, I find a known issue about it. If PG have any fixes, they will update in this GitHub page.
Here is a workaround, you can try it, please set return value to true for ServicePointManager.ServerCertificateValidationCallback that determines whether the specified certificate is accepted for authentication like following code in your getFile method .
WebClient webClient = new WebClient();
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback
(
delegate { return true; }
);
var folder = cacheDir;
webClient.DownloadFileAsync(new Uri("https://www.gamesbypapa.com/wp-content/uploads/sacbrewclubnames.csv"), fullPath);
You put async method in the constructor directly, please do not set it like this way. You can use a static creation method to make a Factory Pattern or use AsyncLazy, please use your favorite browser to search Stephen Cleary's blog about Async Constructors to find more details to fix this issue, I put these method to button click event for testing,
private async void Button_Clicked(object sender, EventArgs e)
{
await RequestPermissions();
string[] paths = { cacheDir, fileName };
fullPath = Path.Combine(paths);
getFile();
}
I notice you set readonly string[,] table1 = new string[20, 0];
, due to readonly property, you cannot set the value like table1[row, 0] = line;
code in the FileStream
method. Please remove readonly, if you want to set it. If you want to use Multidimensional Arrays, please do not set new string[20, 0]
, set new string[20, 1];
at least.
And I invoke FileStream
in the Completed(object sender, AsyncCompletedEventArgs e)
.
By the way, if you have any errors or exceptions, please share it completely with text, do not post screenshot, it will help us to troubleshot this issue quickly.
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.