![]() |
| ||
| how to create shortcuts? I need little help on creating shortcut for my C# app. I want programmatically do this. I intend to create a shortcut in startup menu folder. Maybe you could also show me how to start my app automatically using a registry entry. Thanks! |
| ||
| Re: how to create shortcuts? And what have you found on google so far? |
| ||
| Re: how to create shortcuts? Thanks for reply LizR. Of course I googled that, and I had a little problem I'll tell you now. I made a reference to "Windows Script Host Object Model", then I included IWshRuntimeLibrary and I made a button for testing, so that when I click it, process for creating the shortcut starts, like this: private WshShellClass WshShell;The problem is that I use File.AppendAllText() method to write to file and I got this error: " 'File' is an ambiguous reference between 'System.IO.File' and 'IWshRuntimeLibrary.File' ". It seems to be a little conflict. So, don't worry, I don't wanna lose your time with nothing; I told you now the main problem in my program. And sorry for not pointing to the exact problem. I'll go now; in 7 hours I'm back. |
| ||
| Re: how to create shortcuts? use something like : System.IO.File.AppendAllText |
| ||
| Re: how to create shortcuts? It doesn't work. However thanks for reply. Somebody else? Ideas? |
| ||
| Re: how to create shortcuts? You dont show the code you're using so we're only guessing.. Your short cut looks like it should appear after your code above.. Whats the file bit for? something else? |
| ||
| Re: how to create shortcuts? Try using System.IO.File.Something or IWshRuntimeLibrary.File.Something. |
| ||
| Re: how to create shortcuts? what you have to do is remove "using System.IO;" from the top of your class, and everytime you need to use System.IO.File you will have to type the full namespace. problem is that when you import the namespace for the object that creates your shortcut you share its namespace scope with the "File" namespace scope of the System.IO, so removing the using block at the top of your class fixes the problem. Happy Coding! |
| All times are GMT -4. The time now is 12:34 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC