[IWshRuntimeLibrary] ShotCut,단축아이콘 만들기
"프로젝트 - 참조 - 서비스참조 추가" 에서 Window Script Host Object Model 를 추가 한다.
Created with colorer-take5 library. Type 'csharp' using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.Runtime.InteropServices; using IWshRuntimeLibrary; // COM_ => Window Script Host Object Model namespace StikusInstallWareV1 { /// <summary> /// MainWindow.xaml에 대한 상�� 작용 논리 /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } WshShell wsh; private void button1_Click(object sender, RoutedEventArgs e) { string path = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); wsh = new WshShell(); IWshRuntimeLibrary.IWshShortcut myShotCut; myShotCut = (IWshRuntimeLibrary.IWshShortcut)wsh.CreateShortcut(path + "/scripter.lnk"); myShotCut.TargetPath = "http://www.scripter.co.kr";//@"c:\"; myShotCut.Description = "shotcut test"; myShotCut.IconLocation = Environment.CurrentDirectory +"/"+"scICO_Small.ico"; myShotCut.Save(); } } } |
를 하면 간단하게 만들수 있다.
'C#' 카테고리의 다른 글
[WPF] WebBrowser 에서 Documents 보기 (html) (93) | 2011.05.31 |
---|---|
[Directory Copy] 디렉토리 통채로 카피하기 (61) | 2011.05.23 |
[IWshRuntimeLibrary] ShotCut,단축아이콘 만들기 (150) | 2011.05.20 |
[MouseKeyboardLibrary] 상당히 편리한 마우스키보드 후킹 라이브러리 (227) | 2011.05.20 |
[MultipartURLLoader] [서버에 파일 올리기] 간단 사용법 (74) | 2011.05.19 |
[SimpleFileWriter V2] 디렉토리 생성 , 파일 삭제기능을 추가! (546) | 2011.05.18 |
C#
2011.05.20 17:04