473,215 Members | 1,243 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,215 software developers and data experts.

How to access a IIS Web Site's folder from C#

Hi all,

I've created a IIS Web Site from c# and now I want to make two of its
folders unreadable.

How do I do?

I've tried a lot of code posted on the internet but with no luck.

Any help will me appreciated.

Many Thanks,

Brian
Sep 12 '08 #1
4 1274
Read these...
http://msdn.microsoft.com/en-us/libr...w7(VS.80).aspx
http://msdn.microsoft.com/en-us/library/ms178692.aspx


"Brian Roisentul" <ro*************@gmail.comwrote in message
news:5e**********************************@8g2000hs e.googlegroups.com...
Hi all,

I've created a IIS Web Site from c# and now I want to make two of its
folders unreadable.

How do I do?

I've tried a lot of code posted on the internet but with no luck.

Any help will me appreciated.

Many Thanks,

Brian
Sep 12 '08 #2
Hillbilly,

Thanks for your answer, but I think I didn't express myself correctly.

What I want to do is to have an unreadable folder within an IIS
(Internet Information Services) Web Site programmatically.

So far, I'm able to create an IIS Web Site from C# using
System.DirectoryServices library, but I'm not able to access its
folders' permissions, to make some of them unreadable.

Do you understand my point?

Many Thanks,

Brian
Sep 15 '08 #3
Hi All,

I've been investigating a while and i figured out something pretty
weird:

I downloaded a source code that allows me to do what I want. However,
it's written in asp.net v1.0 and I needed in v2.0. So, I converted it
to that version.

Well, you all can imagine it must have worked, but you're wrong: it
didn't (i'm pretty sure is that because i tried: copying the
procedures and functions I needed to a asp.net v2.0 project. Then,
after the last try didn't work, I tried converting the entire solution
to v2.0 and it did it successfully).

I don't know why, but the v1.0 application is able to create the entry
at the metabase under my virtual directory(IIS://localhost/W3SVC/<web
site id>/root/<new dir's name>) but when I try to do the same using
the v2.0 app i get the following error:

System.Runtime.InteropServices.COMException (0x80070003): The system
cannot find the path specified.

at System.DirectoryServices.DirectoryEntry.Bind(Boole an
throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObj ect()
at System.DirectoryServices.PropertyValueCollection.P opulateList()
at
System.DirectoryServices.PropertyValueCollection.. ctor(DirectoryEntry
entry, String propertyName)
at System.DirectoryServices.PropertyCollection.get_It em(String
propertyName)
at Example.Form1.setDirectory_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)

Do you have any clue on this?

Thanks,

Brian
Sep 17 '08 #4
In the end i think i have no option but using the Location and
Authorization tags within the web.config file of my application.

I'm testing it but it's not working.

Could you give me a hand on this, please?

Thanks,

Brian

On 12 sep, 15:10, "Hillbilly" <someb...@somewhere.comwrote:
Read these...http://msdn.microsoft.com/en-us/libr.../ms178692.aspx

"Brian Roisentul" <roisentul.br...@gmail.comwrote in message

news:5e**********************************@8g2000hs e.googlegroups.com...
Hi all,
I've created a IIS Web Site from c# and now I want to make two of its
folders unreadable.
How do I do?
I've tried a lot of code posted on the internet but with no luck.
Any help will me appreciated.
Many Thanks,
Brian
Sep 22 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Nicolae Fieraru | last post by:
Hi All, I am working on a web site in asp which will be hosted on a Windows 2003 server. I use the following code to connect to the database: Set objConn =...
7
by: Mark Lees | last post by:
How does one increase their Access skills? I'm creating a basic DB for a non-profit organization. I would classify myself as an advanced beginner. I've got some help books but it seems they...
5
by: Andy P via AccessMonster.com | last post by:
I am responsible for maintaining our departmental intranet pages at work. I would like to put a link from our website to a MS Access database which is held on our Network drive. The problem I...
2
by: Ian B | last post by:
This is a basic question for anyone who knows what they're doing with web server admin so hopefully someone will be able to assist me here!... I have a www based asp.net application which allows...
2
by: Brandon | last post by:
I'm getting a Web Access Failed dialog when trying to create a new ASP.NET Web Application. VB.net 2003 on XPSP2 SBS 2003, IIS6 In IIS, I created a new site with a "testsite" host header...
2
by: Chris Newby | last post by:
After googling this I got lots of information and tried a few different things. However pages for a particular site are still consistantly failing with "Access Denied to C:\ ... \Temporary Asp.Net...
7
by: Visitor No 3 | last post by:
My local Crinkles group(U3A), of which I am one, want me to develop a noddy database and web site for their members. Some are computer literate, others not so. I thought an Access 2000 .mdb on a...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
7
by: Agos | last post by:
I developed my first web site using Visual studio 2005. It works very well with Visual Studio. But after I published the web site in a file system folder in my PC using the instructions I found in...
25
by: p byers | last post by:
Good Morning Folks I have a LAN Among the several connections to it are the following four devices: A MAXSTOR network Storage Device A PC running Microsoft Windows 2000 Server 5.0.2195 (SP4) A...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.