473,385 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Create Directory and Sub directory in Web Share (HTTP)

Manikgisl
hi,

can i want to create a directory in Web Share (HTTP) using C#...

Can any body help by giving Sample Code for that ...


Thanks in Advance

With Regards,
Mani
Jan 4 '09 #1
1 1708
Bassem
344 100+
I don't know if i understood you well, but if you want to create directory in a web site using c# the System.IO.Directory class. as follow:

first get the actual directory that your site is allocated on the remote server
string onServerPath = Request.PhysicalApplicationPath;
second create the directory
if (!Directory.Exists(onServerPath + textBox1.Text))
{
Directory.CreateDirectory(onServerPath + textBox1.Text);
}
note: that if the directory that contains the directory you are attempting to create
the containing directory will created first then the sub directory will be created.


Thanks,
Bassem
Jan 4 '09 #2

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

Similar topics

0
by: CM | last post by:
Hi there: I have a web project which can be open and run without problem. I didn't open the web application for a period and during which I didn't modified any IIS items, but now I cannot open any...
4
by: CM | last post by:
Hi there: I have a web project which can be open and run without problem. I didn't open the web application for a period and during which I didn't modified any IIS items, but now I cannot open any...
6
by: Chad Crowder | last post by:
Getting the following error on my production server whether the file exists or not: "System.IO.IOException: Cannot create a file when that file already exists." Here's the code generating the...
1
by: Jack G | last post by:
I've been trying to create a new web application project in Visual Studio 2003 running on a Windows Server 2003. I get the message Window titled Web Access Failed The default Web access mode for...
0
by: Torsten Valentin | last post by:
Hi! I have to write a program that should create a new directory ("c:\test") and share that directory with read-access for everyone and read-write-access for administrators. How do I do that in...
0
by: Torsten Valentin | last post by:
Hi! I am working on a program that should create a new directory ("c:\test") and share that directory with read-access for everyone and read-write-access for administrators. How do I do that in...
2
by: yxq | last post by:
Hello I want to create and delete the folder share, i found that it is ok for generic folder, but it does not work for Root directory(i.e c:\, d:\) The code...
6
by: JonSteng | last post by:
..Net Visual Studio Professional 2003 Version 7.1.3088 ..Net Framework 1.1 SP1 Version 1.1.4322 IIS 5.1 Windows XP Professional SP2 Micron T3000 Laptop (1.5 GHz; 1GB RAM; 40GB HD with 17GB Free)...
1
by: Matt F | last post by:
I need to create a folder in code, and also set sharing to being shared to everyone with full control (or some such variation of security) What I'm doing now is: If Not...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.