Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void appShortcutToDesktop(string linkName)
- {
- try
- {
- string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
- using (StreamWriter streamWriter = new StreamWriter(folderPath + "\\" + linkName + ".url"))
- {
- string executablePath = Application.ExecutablePath;
- streamWriter.WriteLine("[InternetShortcut]");
- streamWriter.WriteLine("URL=file:///" + executablePath);
- streamWriter.WriteLine("IconIndex=0");
- string str = executablePath.Replace('\\', '/');
- streamWriter.WriteLine("IconFile=" + str);
- streamWriter.Flush();
- }
- }
- catch
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement