Create IE shortcuts

xiaoxiao2021-03-06  82

/ / / ============ ?? SpecialFolder =========================// ApplicationData ?? @ "c: / documents and settings / WHJ / Application Data "/// CommonApplicationData? @" C: / Documents and Settings / All Users / Application Data "/// CommonProgramFiles ?? @" C: / Program Files / Common Files "/// cookies ????? @ "C: / documents and settings / whj / cookies" /// desktop ????? @ "c: / documents and settings / WHJ / desktop" /// desktotiRectory ?? @ "C: / Documents and settings / WHJ / desktop "/// favorites ???? @" c: / documents and settings / whj / favorites "/// history ????? @" c: / documents and settings / whj / local settings / history " /// InternetCache ??? @ "c: / documents and settings / whj / local settings / temporary Internet files" /// localapplicationData? @ "C: / documents and settings / whj / local settings / application data" /// MyComputer /// mymusic /// mypictures ???? @ "c: / documents and settings / whj / my documents / my pictures" /// Personal ???? @ "c: / documents and settings / WHJ / MY Documents "/// Programfiles ??? @" c: / program files "/// programs ???? @" c: / documents and settings / WHJ / "Start" menu / program "/// Recent ????? @ "c: / documents and settings / whj / recurent" /// sendto ????? @ "c: / documents and settings / whj / sendto" /// startMenu ???? @ " C: / Documents and Settings / WHJ / "Start" menu "/// startup ????? @" c: / documents and settings / WHJ / "Start" menu / program / launch "/// system ??? ?? @ "c: / winnt / system32" /// Templates ???? @ "c: / documents and settings / whj / templates"

Private Void Createshortcut (String Title, String URL) {? string strfavoritefolder;

? // Create IE shortcut in "Favorites"? StrfavoriteFolder = system.Environment.SpecialFolderPath (Environment.SpecialFolder.favorites) ;? CreateShortcutfile (Title, URL, STRFAVORITEFOLDER);? // Create IE shortcut in "Desktop"? StrfavoriteFolder = system.environment.getFolderPath (Environment.SpecialFolder.Desktop); Createshortcutfile (Title, URL, STRFAVORITEFOLDER);

? // Create IE shortcut in "Link"? Strfavoritefolder = system.environment.special.favorpath (Environment.SpecialFolder.favorites) "// Link"; CreateShortcutfile (Title, URL, STRFAVORITEFOLDER);

? // "Start" menu Create IE shortcut? Strfavoritefolder = system.environment.Special.StartMenu) ;? CreateShortcutfile (Title, URL, StrfavoriteFolder) ;?}

private void CreateShortcutFile (string Title, string URL, string SpecialFolder) {? // Create shortcut file, based on Title? System.IO.StreamWriter objWriter = System.IO.File.CreateText (SpecialFolder "//" Title " .ur "); // Write url to file? Objwriter.writeline (" [InternetShortcut] ");? Objwriter.writeline (" URL = " URL);? // Close File? Objwriter.close ();}

?? private void button1_click (object sender, system.eventargs e)? {??? createshortcut ("Testieshortcut", "http://blog.9cbs.net/luckyjan/"); ??}

转载请注明原文地址:https://www.9cbs.com/read-121619.html

New Post(0)