Click here to Skip to main content
15,905,229 members
Home / Discussions / C#
   

C#

 
QuestionUploading Excel sheet data into SQl problem Pin
S.Rajeshwar30-Mar-07 19:15
S.Rajeshwar30-Mar-07 19:15 
AnswerRe: Uploading Excel sheet data into SQl problem Pin
sujithkumarsl30-Mar-07 19:30
sujithkumarsl30-Mar-07 19:30 
QuestionHow to find the Current Path, in Windows Application Pin
pashitech30-Mar-07 18:32
pashitech30-Mar-07 18:32 
AnswerRe: How to find the Current Path, in Windows Application Pin
Muammar©30-Mar-07 19:53
Muammar©30-Mar-07 19:53 
AnswerRe: How to find the Current Path, in Windows Application Pin
Stefan Troschuetz30-Mar-07 21:26
Stefan Troschuetz30-Mar-07 21:26 
GeneralRe: How to find the Current Path, in Windows Application Pin
Wayne Phipps31-Mar-07 0:25
Wayne Phipps31-Mar-07 0:25 
AnswerRe: How to find the Current Path, in Windows Application Pin
Noman Aftab31-Mar-07 0:41
Noman Aftab31-Mar-07 0:41 
GeneralRe: How to find the Current Path, in Windows Application Pin
Wayne Phipps31-Mar-07 1:14
Wayne Phipps31-Mar-07 1:14 
A similar problem exists when using Environment.CurrentDirectory as the current directory is not necessarily the folder in which your application resides.

You can test this yourself by creating a console application containing the following code:
public static void Main(string[] args)
{
    Console.WriteLine("Current Directory: " + Environment.CurrentDirectory.ToString() );
    Console.WriteLine("Press any key to continue...");
    Console.ReadKey( true );
}


Now if you run the code, it does as you would expect.

But if you open your applications folder in explorer then right-click and 'create a shortcut', you can edit the properties of the shortcut and change the 'Start in' parameter to 'C:\'.

When you then run the application using the shortcut, the current directory is set to 'C:\' and not that of your application.

Please see my previous post for the correct method.




Regards

Wayne Phipps
____________

Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog

Question"Attempted to read or write protected memory." Pin
User 137680030-Mar-07 14:26
User 137680030-Mar-07 14:26 
AnswerRe: "Attempted to read or write protected memory." Pin
Dewald31-Mar-07 0:03
Dewald31-Mar-07 0:03 
GeneralRe: "Attempted to read or write protected memory." Pin
User 137680031-Mar-07 5:55
User 137680031-Mar-07 5:55 
QuestionUser control without being in the GAC Pin
Esmo200030-Mar-07 12:36
Esmo200030-Mar-07 12:36 
AnswerRe: User control without being in the GAC Pin
J$30-Mar-07 13:32
J$30-Mar-07 13:32 
Questionhow to invisible a row of Datagridview ? Pin
hdv21230-Mar-07 11:27
hdv21230-Mar-07 11:27 
Questionhow can I get the lighter tone of color Pin
samreengr830-Mar-07 11:24
samreengr830-Mar-07 11:24 
AnswerRe: how can I get the lighter tone of color Pin
led mike30-Mar-07 12:00
led mike30-Mar-07 12:00 
AnswerRe: how can I get the lighter tone of color Pin
Kitchen_31-Mar-07 2:21
Kitchen_31-Mar-07 2:21 
AnswerRe: how can I get the lighter tone of color Pin
Thomas Stockwell1-Apr-07 4:36
professionalThomas Stockwell1-Apr-07 4:36 
QuestionMoving DataRows from one DataTable to another Pin
Pualee30-Mar-07 10:48
Pualee30-Mar-07 10:48 
AnswerRe: Moving DataRows from one DataTable to another Pin
gauthee30-Mar-07 20:18
gauthee30-Mar-07 20:18 
QuestionHow to make one column of ListView invisable? Pin
Khoramdin30-Mar-07 10:43
Khoramdin30-Mar-07 10:43 
AnswerRe: How to make one column of ListView invisable? Pin
led mike30-Mar-07 12:01
led mike30-Mar-07 12:01 
GeneralRe: How to make one column of ListView invisable? Pin
Khoramdin30-Mar-07 19:32
Khoramdin30-Mar-07 19:32 
GeneralRe: How to make one column of ListView invisable? Pin
led mike2-Apr-07 4:27
led mike2-Apr-07 4:27 
QuestionStreamreader and read file Pin
Saamir30-Mar-07 10:35
Saamir30-Mar-07 10:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.