Hello all:
I'm a new C# dude so apologize for the simplicity...
I was given a solution in another thread that I cannot seem to duplicate?
In C# VS2005, I'm simply trying to get the application startup path BUT in the IDE when I type "Application." only DoEvents, Equals, Exit, ReferenceEquals and Run show up as possible selections??? Manually typing "StartupPath" gives me an error. Is there a declaration I'm missing?
Thank you
Marshall
Loading
MarshallPosted Apr 30, 2007, 7:16 AM
Thank you
Marshall
Huang ElitePosted Apr 28, 2007, 11:07 PM
May be you can try using System.Enviroment.CurrentDirectory ..
MarshallPosted Apr 27, 2007, 4:22 PM
MY app is a smartdevice app for PPC2003 and above which uses the Compact Framework 2.0 . This being a subset of the .NET Framework 2.0 ... guess what ? StartupPath is not implemented in the CF2.0. My bad guys!
Appreciate the help!
Thank you
Marshall
SokakPosted Apr 26, 2007, 6:32 PM
string path = System.Windows.Forms.Application.StartupPath;
Other than that, as it's been said, it should just work. You can check your project references to see that System.Windows.Forms is pointing to a v2.0. If you create a new Windows Forms C# project you should be able to see the .StartupPath property. If not then something is very wrong with your .Net framework.
MarshallPosted Apr 25, 2007, 11:26 AM
I've got the same uses items with the addition of System.IO and still cannot get the Application.StartupPath to work??? I'm now installing SP1 to see if this fixes the problem. I'm an old Borland C++ Builder person and this is quite frustrating in my first venture into MFC VS. I like mostly what I see but am finding that the code examples don't exactly work as pictured.
Thank you
kamalakar raoPosted Apr 25, 2007, 8:40 AM
using
System.Collections.Generic;using
System.ComponentModel;using
System.Data;using
System.Drawing;using
System.Text;using
System.Windows.Forms;These are all default imports when we would create new project in VS 2005
For myself Application.StartupPath is working.