منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
لعمل اختصار على سطح المكتب - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : الأقسام التعليمية - المنتدى القديم (http://vb4arb.com/vb/forumdisplay.php?fid=90)
+--- قسم : مكتبة أكواد المنتدى (http://vb4arb.com/vb/forumdisplay.php?fid=111)
+---- قسم : مكتبة أكواد .net (http://vb4arb.com/vb/forumdisplay.php?fid=117)
+---- الموضوع : لعمل اختصار على سطح المكتب (/showthread.php?tid=6257)



لعمل اختصار على سطح المكتب - RaggiTech - 17-10-12

كاتب الموضوع : Boutemine Oualid

السلام عليكم و رحمة الله وبركاته


كود :
private static string desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
private static string fileName = "Calc.lnk";
private static void Main(string[] args)
{
WshShell shell = new WshShell();
IWshShortcut link = (IWshShortcut)shell.CreateShortcut(Path.Combine(desktop, fileName));
link.TargetPath = @"C:\WINDOWS\system32\calc.exe";
link.Save();
}