laomms / PidKeyTool

密钥检测工具. Tool for check Microsoft Product Key
270 stars 54 forks source link

Inquiry about Support for /CheckKey and /CheckRedeemKey Commands in PidKeyTool #40

Closed Denisphuket closed 8 months ago

Denisphuket commented 9 months ago

Hello,

I am currently working with your PidKeyTool.v.3.5 and would like to inquire about the specifics of using the /CheckKey and /CheckRedeemKey commands. I'm attempting to use these commands via C# by passing command line arguments using Process.Start, but I'm encountering some difficulties. Could you please confirm whether these commands are supported by your tool, and if so, are there any particular considerations or steps I should be aware of when using them?

Any guidance or advice you can provide would be greatly appreciated. PidKeyTool.v.3.45 work ok


using System;
using System.Diagnostics;
using System.IO;

namespace PidKeyToolRunner
{
    class Program
    {
        static void Main(string[] args)
        {
            string exePath = "PidKey.exe"; 
            string output = "";

            try
            {

                using (Process p1 = new Process())
                {
                    p1.StartInfo.CreateNoWindow = true;
                    p1.StartInfo.FileName = "cmd.exe";
                    p1.StartInfo.Arguments = "/c " + exePath + " /CheckKey PKRVP-TJNRT-V2DPX-HD4TX-BKPH3,6VND6-8MCCJ-PRVX8-Q3FBB-39PH3";
                    p1.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
                    p1.StartInfo.UseShellExecute = false;
                    p1.StartInfo.RedirectStandardOutput = true;
                    p1.StartInfo.RedirectStandardError = true;

                    Console.WriteLine("Запуск процесса...");
                    p1.Start();

                    output = p1.StandardOutput.ReadToEnd();
                    string errorOutput = p1.StandardError.ReadToEnd();
                    p1.WaitForExit();

                    int exitCode = p1.ExitCode;
                    Console.WriteLine("Процесс завершен с кодом " + exitCode);
                    Console.WriteLine("Вывод процесса:\n" + output);

                    if (!string.IsNullOrEmpty(errorOutput))
                    {
                        Console.WriteLine("Ошибка:\n" + errorOutput);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Произошла ошибка: " + ex.Message);
            }

            Console.ReadLine();
        }
    }
}
laomms commented 8 months ago

The latest version removes this feature

Denisphuket commented 8 months ago

The latest version removes this feature

Will this be fixed or have you finally ruled out the possibility of creating an api wrapper?