Develop의 Tistory

Language/C#(CLR,.NET)

[C#] LINK(.LNK, 바로가기)파일의 실제 파일명 알아내기

소소한 늙은 개발자의 메모장 2013. 4. 1. 09:40
반응형
(追記) (追記ここまで)

참조에 COM객체 "Windows Script Host Object Model"(1.0) 추가

 1: string fileName = @"Temp.lnk";
 2: string fileExt = Path.GetExtension(fileName);
 3: if (fileExt.Trim().ToLower() == ".lnk")
 4: {
 5: IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShell();
 6: IWshRuntimeLibrary.IWshShortcut link = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(fileName);
 7: fileName = link.TargetPath;
 8: }

출처 : 모름

반응형
(追記) (追記ここまで)

티스토리툴바

AltStyle によって変換されたページ (->オリジナル) /