473,566 Members | 3,004 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to set the path for directory

24 New Member
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.Ho stingEnvironmen t.ApplicationPh ysicalPAth +"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\Applic ationName\image s\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.Ho stingEnvironmen t.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

Rama
May 24 '07 #1
0 931

Sign in to post your reply or Sign up for a free account.

Similar topics

31
3880
by: John Roth | last post by:
I'm adding a thread for comments on Gerrit Holl's pre-pep, which can be found here: http://tinyurl.com/2578q Frankly, I like the idea. It's about time that all of the file and directory stuff in the os module got objectified properly (or at least with some semblance of OO propriety!) In the issues section:
3
2353
by: Peter Schwalm | last post by:
I'd like to modify the python search path depending on the source directory of the script being started. The reason is: I use a version control system, and the python scripts and modules are migrated through several stages before they are used in production. A python script running in a development environment should use different modules -...
1
53436
by: Matthias Ludwig | last post by:
I'm trying to create a directory on the web server with a vb.net code: .... Dim dirName As String = "w:\filepath\images" If Not Directory.Exists(dirName) Then Directory.CreateDirectory(dirName) Label1.Text = "Directory created" Else
8
17455
by: Glenn A. Harlan | last post by:
Why am I receiving the below error when calling - Path.GetTempFileName() The directory name is invalid. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details:...
34
3233
by: Reinhold Birkenfeld | last post by:
Hi, the arguments in the previous thread were convincing enough, so I made the Path class inherit from str/unicode again. It still can be found in CVS: /python/nondist/sandbox/path/{path.py,test_path.py} One thing is still different, though: a Path instance won't compare to a regular string.
2
23368
by: Rob Cowie | last post by:
Hi, Given a string representing the path to a file, what is the best way to get at the filename? Does the OS module provide a function to parse the path? or is it acceptable to split the string using '/' as delimiters and get the last 'word'. The reason I'm not entirely happy with that method is that it is platform specific. I would prefer...
1
4598
by: Raquel | last post by:
Ok, so these are the two pieces of information regarding the location of archived logs during a rollforward recovery in a recoverable database: 1. OVERFLOWLOGPATH configuration parameter can specify a location for DB2 to find log files that are needed for rollforward operations. 2. The database configuration file parameter 'userexit'...
3
7946
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images C:\Inetpub\wwwroot\RunReportASP is the directory of my virtual directory for my app. In it's properties I did check "Write" as a permission. What else...
4
6887
by: Vlad | last post by:
I am having problems using the file.create method within a function that is called when looping through an array of filepaths. If I call my function with a hardcoded file path --C:\Temp.txt the function creates the file as expected. When I loop through my array I get the error - "ArgumentException was unhandled - Illegal characters in...
7
1724
by: Daniel | last post by:
Hello, I'm writing some unit tests for my python software which uses packages. Here is the basic structure: mypackage __init__.py module1 __init__.py mod1.py
0
7673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.