JananiSharma

Hi

I created an application in c:\inetpub\wwwroot\windowsapplication. I want to save a file in folder "Image"

I used Path.GetFullPath("Image") but it configures c:\inetpub\wwwroot\windowsapplication\bin\debug\image .It shows error cant find the folder.

1. Tell me how to configure the folder in the windows application.

2. I want to create a folder in the path where the windowsapplication.msi installs.

Thanks

Jhanani.R




Re: Windows Forms Data Controls and Databinding How to get the current directory path c# winfows application

Eli Gazit

To get the path that the Exe is running at (which is a good location to add paths like "Image"), use:

string exePath = Application.StartupPath + "\image";

This path is the ..\bin\debug\image path when you run it on VS and ..\image path when you run it after installation.

But you are talking about a path for a web-application, are you sure you want the windows application way...






Re: Windows Forms Data Controls and Databinding How to get the current directory path c# winfows application

Ken Tucker

In the solution explorer make sure the images in the image directory copy to output property is set to always copy or copy if newer. This will make sure the image directory is created when you run the app






Re: Windows Forms Data Controls and Databinding How to get the current directory path c# winfows application

JananiSharma

Hi
Am sorry i cant get you.I dont want to create Image folder manully.It should be created by automatically.
Thats is in the windows application before creating exe i want to check whether the folder is created by my coding and the images are uploaded in that folder.I want to create the folder in c:\windowsapplication\Images and not in c:\windowsapplication\bin\debug\.

And whikle installing the msi the image folder should created in the path which is given by th user(that is the path where the msi installed)

I tried to create folder using Directory.CreateDirectory.Before that i want to get the current path So i used Directory.GetCurrentDirectory(). It gives the path of the image which i selected to upload.

Please solve my problems
Thanks
Jhanani.R