delete
delete
hi,
use bellow code check shotcut.
#region checkforshortcut /// <summary> /// create application reference file on users desktop /// if not have 1 when program loaded. /// if not debugging in visual studio check application reference /// if (!debug) /// checkforshortcut(); /// endif /// </summary> static void checkforshortcut() { if (applicationdeployment.isnetworkdeployed) { applicationdeployment ad = applicationdeployment.currentdeployment; if (ad.isfirstrun) { assembly code = assembly.getexecutingassembly(); string company = string.empty; string productname = string.empty; if (attribute.isdefined(code, typeof(assemblycompanyattribute))) { assemblycompanyattribute ascompany = (assemblycompanyattribute)attribute.getcustomattribute(code, typeof(assemblycompanyattribute)); company = ascompany.company; } if (attribute.isdefined(code, typeof(assemblydescriptionattribute))) { assemblyproductattribute asproduct = (assemblyproductattribute)attribute.getcustomattribute(code, typeof(assemblyproductattribute)); productname = asproduct.product; } if (!string.isnullorempty(company) && !string.isnullorempty(productname)) { string desktoppath = string.empty; desktoppath = string.concat(environment.getfolderpath(environment.specialfolder.desktop), "\\", productname, ".appref-ms"); string shortcutname = string.empty; shortcutname = string.concat(environment.getfolderpath(environment.specialfolder.programs), "\\", company, "\\", productname, ".appref-ms"); system.io.file.copy(shortcutname, desktoppath, true); } } } } #endregion
happy coding
thanks.
knight data access layer - .net orm, linq provider, , more https://www.kellermansoftware.com/p-47-net-data-access-layer.aspx
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment