mirror of
https://github.com/Stone-Red-Code/ImgurAutoUploader.git
synced 2026-09-04 00:56:11 +02:00
Fixed Crash
This commit is contained in:
@@ -0,0 +1 @@
|
||||
ImgurAutoUploader/bin/Release/net5.0-windows/publish
|
||||
Binary file not shown.
Binary file not shown.
@@ -58,12 +58,16 @@ namespace ImgurAutoUploader
|
||||
|
||||
private async void Upload()
|
||||
{
|
||||
string link = "";
|
||||
|
||||
upload = true;
|
||||
UploadProgressBar.Visibility = Visibility.Visible;
|
||||
SecretButton.Visibility = Visibility.Collapsed;
|
||||
UploadButton.Visibility = Visibility.Collapsed;
|
||||
|
||||
HttpClient httpClient = new();
|
||||
try
|
||||
{
|
||||
using HttpClient httpClient = new();
|
||||
|
||||
string filePath = @"img.png";
|
||||
using var fileStream = File.OpenRead(filePath);
|
||||
@@ -71,14 +75,19 @@ namespace ImgurAutoUploader
|
||||
ImageEndpoint imageEndpoint = new ImageEndpoint(apiClient, httpClient);
|
||||
var imageUpload = await imageEndpoint.UploadImageAsync(fileStream);
|
||||
|
||||
string link = imageUpload?.Link ?? "Error";
|
||||
link = imageUpload?.Link ?? "Error";
|
||||
}
|
||||
catch
|
||||
{
|
||||
link = "Error";
|
||||
}
|
||||
Clipboard.SetText(link);
|
||||
|
||||
LinkTextBlock.Text = link;
|
||||
UploadProgressBar.Visibility = Visibility.Collapsed;
|
||||
LinkTextBlock.Visibility = Visibility.Visible;
|
||||
LinkTextBlock.Text = imageUpload.Link;
|
||||
|
||||
timer.Start();
|
||||
System.Collections.Hashtable a;
|
||||
}
|
||||
|
||||
private void TimerTick(object sender, EventArgs e)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 8.2 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user