336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

void ModifyShortcutTargetName(string shortcutFilename)

{

WshShell shell = new WshShell();

FileInfo LinkFile = new FileInfo(shortcutFilename);

if (LinkFile.Exists)

{

IWshShortcut link = (IWshShortcut)shell.CreateShortcut(LinkFile.FullName);

link.TargetPath = link.TargetPath.Replace("AAA.exe", "BBB.exe");

link.Save();

}


// 아래 코드는 Windows XP 에서 실행되지 않는다

/*if (File.Exists(shortcutFilename) == false)

return;


var pathOnly = Path.GetDirectoryName(shortcutFilename);

var filenameOnly = Path.GetFileName(shortcutFilename);


var shell = new Shell32.Shell();

var folder = shell.NameSpace(pathOnly);

if (folder == null)

return;


var folderItem = folder.ParseName(filenameOnly);

if (folderItem == null)

return;


if (folderItem.IsLink == false)

return;


var link = (Shell32.ShellLinkObject)folderItem.GetLink;

link.Path = link.Path.Replace("AAA.exe", "BBB.exe");

link.Save();*/

}

Posted by 역시인생한방
,