Ejemplo n.º 1
0
        private void vtButton_Click(object sender, EventArgs e)
        {
            string key = vtKeyTextBox.Text;

            if (string.IsNullOrEmpty(key) || key.Length != 64)
            {
                MessageBox.Show("Please insert correct Virus Total API key");
                return;
            }
            DetectionInfo dt       = new DetectionInfo(lastFilePath);
            VirusTotal    vt       = new VirusTotal(key);
            JsonParser    jp       = new JsonParser();
            string        report   = vt.GetFileReport(dt.getMD5());
            string        comments = vt.GetFileComments(dt.getMD5());

            vtResult   = jp.ParseResults(JObject.Parse(report));
            vtComments = jp.ParseComments(JObject.Parse(comments));
            var name = Path.GetTempFileName();

            File.WriteAllText(name + ".txt", vtResult + "\n\n" + vtComments);
            System.Diagnostics.Process.Start(name + ".txt");
        }