add invalid key warning
This commit is contained in:
parent
afb27233f8
commit
d556a5d739
|
@ -11,6 +11,9 @@
|
|||
"UploadForm_Info": "Informace o souboru",
|
||||
"UploadForm_Upload": "Nahrát",
|
||||
"UploadForm_Cancel": "Zrušit",
|
||||
"UploadForm_NoApiKey": "Nepřidali jste API klíč. Jděte to nastavení a přidejte ho.",
|
||||
"UploadForm_InvalidLength": "Přidali jste API klíč, ale nemá správnou délku. Měl by mít 64 znaků.",
|
||||
"UploadForm_InvalidKey": "Špatný API klíč",
|
||||
"Message_Idle": "Nic.",
|
||||
"Message_Init": "Inicializace...",
|
||||
"Message_Check": "Kontrola...",
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
"UploadForm_Info": "File information",
|
||||
"UploadForm_Upload": "Upload",
|
||||
"UploadForm_Cancel": "Cancel",
|
||||
"UploadForm_NoApiKey": "You have not entered an API key. Please go to settings and add one.",
|
||||
"UploadForm_InvalidLength": "You have entered an API key, but the key does not have valid length. Key should contain 64 characters.",
|
||||
"UploadForm_InvalidKey": "Invalid API key",
|
||||
"Message_Idle": "Idle.",
|
||||
"Message_Init": "Initializing...",
|
||||
"Message_Check": "Checking...",
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
"UploadForm_Info": "Informations sur le fichier",
|
||||
"UploadForm_Upload": "Mettre en ligne",
|
||||
"UploadForm_Cancel": "Annuler",
|
||||
"UploadForm_NoApiKey": "You have not entered an API key. Please go to settings and add one.",
|
||||
"UploadForm_InvalidLength": "You have entered an API key, but the key does not have valid length. Key should contain 64 characters.",
|
||||
"UploadForm_InvalidKey": "Invalid API key",
|
||||
"Message_Idle": "Prêt.",
|
||||
"Message_Init": "Initialisation...",
|
||||
"Message_Check": "Vérification...",
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
"UploadForm_Info": "Dateiinformationen",
|
||||
"UploadForm_Upload": "Hochladen",
|
||||
"UploadForm_Cancel": "Abbrechen",
|
||||
"UploadForm_NoApiKey": "You have not entered an API key. Please go to settings and add one.",
|
||||
"UploadForm_InvalidLength": "You have entered an API key, but the key does not have valid length. Key should contain 64 characters.",
|
||||
"UploadForm_InvalidKey": "Invalid API key",
|
||||
"Message_Idle": "Leerlauf.",
|
||||
"Message_Init": "Initialisieren ...",
|
||||
"Message_Check": "Überprüfen ...",
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
"UploadForm_Info": "Информация о файле",
|
||||
"UploadForm_Upload": "Отправить",
|
||||
"UploadForm_Cancel": "Отмена",
|
||||
"UploadForm_NoApiKey": "You have not entered an API key. Please go to settings and add one.",
|
||||
"UploadForm_InvalidLength": "You have entered an API key, but the key does not have valid length. Key should contain 64 characters.",
|
||||
"UploadForm_InvalidKey": "Invalid API key",
|
||||
"Message_Idle": "Ожидание.",
|
||||
"Message_Init": "Инициализация...",
|
||||
"Message_Check": "Проверка...",
|
||||
|
|
Binary file not shown.
|
@ -23,6 +23,9 @@ namespace uploader
|
|||
public string UploadForm_Info = "File information";
|
||||
public string UploadForm_Upload = "Upload";
|
||||
public string UploadForm_Cancel = "Cancel";
|
||||
public string UploadForm_NoApiKey = "You have not entered an API key. Please go to settings and add one.";
|
||||
public string UploadForm_InvalidLength = "You have entered an API key, but the key does not have valid length. Key should contain 64 characters.";
|
||||
public string UploadForm_InvalidKey = "Invalid API key";
|
||||
|
||||
public string Message_Idle = "Idle.";
|
||||
public string Message_Init = "Initializing...";
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace uploader
|
|||
{
|
||||
// Set working directory to exe location because of language files
|
||||
Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
|
||||
//LocalizationHelper.Export();
|
||||
|
||||
var settings = Settings.LoadSettings();
|
||||
if (!string.IsNullOrEmpty(settings.Language))
|
||||
|
|
|
@ -64,6 +64,18 @@ namespace uploader
|
|||
|
||||
private void Upload()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_settings.ApiKey))
|
||||
{
|
||||
MessageBox.Show(LocalizationHelper.Base.UploadForm_NoApiKey, LocalizationHelper.Base.UploadForm_InvalidKey, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_settings.ApiKey.Length != 64)
|
||||
{
|
||||
MessageBox.Show(LocalizationHelper.Base.UploadForm_InvalidLength, LocalizationHelper.Base.UploadForm_InvalidKey, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
ChangeStatus(LocalizationHelper.Base.Message_Init);
|
||||
_client = new RestClient("https://www.virustotal.com");
|
||||
// TODO: check if file exists
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue