Click here to Skip to main content
15,886,734 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How could i get the right path for a file in C#?
Posted
Comments
[no name] 17-Oct-12 8:13am    
The "right path" is the one that leads to the file. Not clear what it is that you are asking.
engmebeed 18-Oct-12 7:21am    
I have another problem.
How i retrieve data from file by expected order and i want to use it in statistics in log system.
I want also to monitor all moves of the mouse (click, double Click ,....) .
Could you help in any part?
Akinmade Bond 17-Oct-12 11:47am    
What do you mean by the right path?
engmebeed 18-Oct-12 2:43am    
full path
Akinmade Bond 18-Oct-12 5:52am    
And I'm guessing you've solved your problem through solution 1?

1 solution

Use openfiledialog,for following code
C#
private void button1_Click(object sender,Eventargs e)
{
   if(openFileDialog1.ShowDialog()==DialogResult.OK)
   {
      textbox1.Text=Path.GetFullPath(openFileDialog1.FileName);
   }
}

additionally add the namespace System.IO;
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900