| | |
How to set the path for directory
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2007
Posts: 12
Reputation:
Solved Threads: 0
hi am developing an application to upload images to gridview which i have completed ,now i need to create directories and subdirectories to upload the images according to their type i have written a class to read all directories like
public Classname[] Getdirectories(string name)
{
string basepath=System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPAth +"images"+"/"+name;
string[] files=Directory.GetDirectories(basepath);
}
this coding was working only for the first set of subdirectories
but on further read it gives an error like
Could not find a part of the path 'C:\Documents and Settings\ApplicationName\images\Sub'.
This is because ,a directory name is missing between the ' images' folder and 'Sub' Folder
i changed the coding like
String basepath=System.Web.Hosting.HostingEnvironment.Mappath(name);
but it gives me an error like
The relative virtual path 'Directoryname' is not allowed here
can anyone help me on this regard on how to set the path for the directory in oder to read them dynamically
plz help me on this regard
Shruthi
public Classname[] Getdirectories(string name)
{
string basepath=System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPAth +"images"+"/"+name;
string[] files=Directory.GetDirectories(basepath);
}
this coding was working only for the first set of subdirectories
but on further read it gives an error like
Could not find a part of the path 'C:\Documents and Settings\ApplicationName\images\Sub'.
This is because ,a directory name is missing between the ' images' folder and 'Sub' Folder
i changed the coding like
String basepath=System.Web.Hosting.HostingEnvironment.Mappath(name);
but it gives me an error like
The relative virtual path 'Directoryname' is not allowed here
can anyone help me on this regard on how to set the path for the directory in oder to read them dynamically
plz help me on this regard
Shruthi
•
•
Join Date: May 2007
Posts: 20
Reputation:
Solved Threads: 2
you get the error probably, inside your folder dun have "sub" folder name. you need to check it, if didnt found the folder, u need create a new folder.
based on the code, i didnt found any coding that create a new folder when the system didnt found ur folder.
hope it can help u
based on the code, i didnt found any coding that create a new folder when the system didnt found ur folder.
hope it can help u
![]() |
Similar Threads
- get path to java compiler (Java)
- Physical path for the virtual directory (ASP.NET)
- How to specify virtual directory path during .net deployment (ASP.NET)
- I need help with setting up a "Path"...... (Python)
- how to set relative path in a .config file? (Java)
- Changing permission for www/html directory (Window and Desktop Managers)
Other Threads in the ASP.NET Forum
- Previous Thread: Layer ASP Item Error
- Next Thread: about asp.net syllabus
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax alltypeofvideos appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox child class compatible content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv form gridview gudi iis image javascript list listbox menu mouse mssql nameisnotdeclared news novell numerical opera order parent problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security select serializesmo.table sessionvariables silverlight smoobjects software sql sql-server ssl tracking treeview typeof validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming wizard xsl





