Hi guys ...
I just wanted to create virtual directory using VB.net . i can manage that
... when i create the virtual directory how can i set anonymous access off.
following is my code
==============
Dim IISSchema As New System.Director yServices.Direc toryEntry("IIS://"
& WebSite & "/Schema/AppIsolated")
Dim CanCreate As Boolean = Not
IISSchema.Prope rties("Syntax") .Value.ToString .ToUpper() = "BOOLEAN"
IISSchema.Dispo se()
If CanCreate Then
Dim PathCreated As Boolean
Try
Dim IISAdmin As New
System.Director yServices.Direc toryEntry("IIS://" & WebSite &
"/W3SVC/1/Root")
'make sure folder exists
If Not System.IO.Direc tory.Exists(Pat h) Then
System.IO.Direc tory.CreateDire ctory(Path)
PathCreated = True
End If
'If the virtual directory already exists then delete it
For Each VD As System.Director yServices.Direc toryEntry In
IISAdmin.Childr en
If VD.Name = AppName Then
'IISAdmin.Invok e("Delete", New String()
{VD.SchemaClass Name, AppName})
'IISAdmin.Commi tChanges()
MsgBox("Virtual directory already exists..!.",
MsgBoxStyle.Inf ormation, "Create Virtual Directory")
Exit Sub
End If
Next VD
'Create and setup new virtual directory
Dim VDir As System.Director yServices.Direc toryEntry =
IISAdmin.Childr en.Add(AppName, "IIsWebVirtualD ir")
VDir.Properties ("Path").Item(0 ) = Path
VDir.Properties ("AppFriendlyNa me").Item(0) = AppName
VDir.Properties ("EnableDirBrow sing").Item(0) = False
VDir.Properties ("AccessRead"). Item(0) = True
VDir.Properties ("AccessExecute ").Item(0) = False '
VDir.Properties ("AccessWrite") .Item(0) = False
VDir.Properties ("AccessScript" ).Item(0) = True
VDir.Properties ("AuthNTLM").It em(0) = False 'Integreted
Windows Authontocation
VDir.Properties ("EnableDefault Doc").Item(0) = True
VDir.Properties ("DefaultDoc"). Item(0) =
"default.aspx,d efault.htm,defa ult.asp"
VDir.Properties ("AspEnablePare ntPaths").Item( 0) = True
VDir.CommitChan ges()
VDir.Invoke("Ap pCreate", 1)
So can you please tell me how to set Anonymous access OFF.
-Rosy
- R 2 3896
..Properties("A uthAnonymous")( 0) = False
--
Get a powerful web, database, application, and email hosting with KJM
Solutions http://www.kjmsolutions.com
"Rose winsle" <ch******@solut ionsit.com.au> wrote in message
news:es******** ******@TK2MSFTN GP03.phx.gbl... Hi guys ...
I just wanted to create virtual directory using VB.net . i can manage that .. when i create the virtual directory how can i set anonymous access off.
following is my code ==============
Dim IISSchema As New System.Director yServices.Direc toryEntry("IIS://" & WebSite & "/Schema/AppIsolated") Dim CanCreate As Boolean = Not IISSchema.Prope rties("Syntax") .Value.ToString .ToUpper() = "BOOLEAN" IISSchema.Dispo se()
If CanCreate Then Dim PathCreated As Boolean
Try Dim IISAdmin As New System.Director yServices.Direc toryEntry("IIS://" & WebSite & "/W3SVC/1/Root")
'make sure folder exists If Not System.IO.Direc tory.Exists(Pat h) Then System.IO.Direc tory.CreateDire ctory(Path) PathCreated = True End If
'If the virtual directory already exists then delete it For Each VD As System.Director yServices.Direc toryEntry In IISAdmin.Childr en If VD.Name = AppName Then 'IISAdmin.Invok e("Delete", New String() {VD.SchemaClass Name, AppName}) 'IISAdmin.Commi tChanges() MsgBox("Virtual directory already exists..!.", MsgBoxStyle.Inf ormation, "Create Virtual Directory") Exit Sub End If Next VD
'Create and setup new virtual directory Dim VDir As System.Director yServices.Direc toryEntry = IISAdmin.Childr en.Add(AppName, "IIsWebVirtualD ir") VDir.Properties ("Path").Item(0 ) = Path VDir.Properties ("AppFriendlyNa me").Item(0) = AppName VDir.Properties ("EnableDirBrow sing").Item(0) = False VDir.Properties ("AccessRead"). Item(0) = True VDir.Properties ("AccessExecute ").Item(0) = False ' VDir.Properties ("AccessWrite") .Item(0) = False VDir.Properties ("AccessScript" ).Item(0) = True VDir.Properties ("AuthNTLM").It em(0) = False 'Integreted Windows Authontocation VDir.Properties ("EnableDefault Doc").Item(0) = True VDir.Properties ("DefaultDoc"). Item(0) = "default.aspx,d efault.htm,defa ult.asp" VDir.Properties ("AspEnablePare ntPaths").Item( 0) = True
VDir.CommitChan ges()
VDir.Invoke("Ap pCreate", 1)
So can you please tell me how to set Anonymous access OFF.
-Rosy - R
Hi vbnetdev,
Thanks for the reply .. but i tried this. it gives me follwing error
"Index was out of range.Must be non-negative and less than the size of
collection, parameter name :Index"
pls help me
-Rose
"vbnetdev" <vb******@commu nity.nospam> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. .. .Properties("Au thAnonymous")(0 ) = False
-- Get a powerful web, database, application, and email hosting with KJM Solutions http://www.kjmsolutions.com "Rose winsle" <ch******@solut ionsit.com.au> wrote in message news:es******** ******@TK2MSFTN GP03.phx.gbl... Hi guys ...
I just wanted to create virtual directory using VB.net . i can manage that .. when i create the virtual directory how can i set anonymous access off.
following is my code ==============
Dim IISSchema As New System.Director yServices.Direc toryEntry("IIS://" & WebSite & "/Schema/AppIsolated") Dim CanCreate As Boolean = Not IISSchema.Prope rties("Syntax") .Value.ToString .ToUpper() = "BOOLEAN" IISSchema.Dispo se()
If CanCreate Then Dim PathCreated As Boolean
Try Dim IISAdmin As New System.Director yServices.Direc toryEntry("IIS://" & WebSite & "/W3SVC/1/Root")
'make sure folder exists If Not System.IO.Direc tory.Exists(Pat h) Then System.IO.Direc tory.CreateDire ctory(Path) PathCreated = True End If
'If the virtual directory already exists then delete it For Each VD As System.Director yServices.Direc toryEntry In IISAdmin.Childr en If VD.Name = AppName Then 'IISAdmin.Invok e("Delete", New String() {VD.SchemaClass Name, AppName}) 'IISAdmin.Commi tChanges() MsgBox("Virtual directory already exists..!.", MsgBoxStyle.Inf ormation, "Create Virtual Directory") Exit Sub End If Next VD
'Create and setup new virtual directory Dim VDir As System.Director yServices.Direc toryEntry = IISAdmin.Childr en.Add(AppName, "IIsWebVirtualD ir") VDir.Properties ("Path").Item(0 ) = Path VDir.Properties ("AppFriendlyNa me").Item(0) = AppName VDir.Properties ("EnableDirBrow sing").Item(0) = False VDir.Properties ("AccessRead"). Item(0) = True VDir.Properties ("AccessExecute ").Item(0) = False ' VDir.Properties ("AccessWrite") .Item(0) = False VDir.Properties ("AccessScript" ).Item(0) = True VDir.Properties ("AuthNTLM").It em(0) = False 'Integreted Windows Authontocation VDir.Properties ("EnableDefault Doc").Item(0) = True VDir.Properties ("DefaultDoc"). Item(0) = "default.aspx,d efault.htm,defa ult.asp" VDir.Properties ("AspEnablePare ntPaths").Item( 0) = True
VDir.CommitChan ges()
VDir.Invoke("Ap pCreate", 1)
So can you please tell me how to set Anonymous access OFF.
-Rosy - R
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: muzerb |
last post by:
What are the account requirements for aspx pages to be accesse
anonymously on Windows 2003 server?.
When I view my aspx page in a browser locally or remotely I always ge
prompted for user and password. When I provide credentials for user i
the admin group the page displays correctly.
I do not get prompted when viewing .htm files.
I...
|
by: yurps |
last post by:
Hello,
I got a weird problem...I didn't set up this machine so I don't know
what possibly went wrong...IIS set up after VS.NET..
On a virtual directory for a web app...I go to properties and click
on the 'Directory Security' tab, click the 'Edit' button,check
anonymous access, type in username/password for account, check
'Integrated...
|
by: H. S. |
last post by:
Hi,
I am trying to compile these set of C++ files and trying out class
inheritence and function pointers. Can anybody shed some light why my
compiler is not compiling them and where I am going wrong?
I am using g++ (GCC) 3.3.5 on a Debian Sarge system. The compiler complains:
//****************************
//****************************...
|
by: Kevin Hoskins |
last post by:
Is there anyway to force authentication of the Anonymous user?
Here is the situation:
I have an ASP.NET page which calls an assembly which requires a certain
level of permissions. The page is running in a virtual server whose
anonymous user is a network account with the required permissions. This
allows anyone to view the page and see the...
|
by: Martin |
last post by:
Hi,
I am getting an "Access Denied" error when attempting to browse asp.net
pages.
I have installed ASP.NET 1.1.4322 on a domain controller.
The machine also has ASP.NET 1.0.3705 installed on it.
The machine is win 2k server. IIS is installed.
I have already run aspnet_regiis - i to reinstall the .net framework.
| |
by: Yogesh Pancholi |
last post by:
For some unexplained reason, I am suddenly unable to browse to a virtual
directory on my laptop. I have a number of sample websites to which I could
happliy browse up until last week. As of Monday, if I browse to any of the
sites, I get an HttpException saying "The directory does not exist or is not
accessible because of security settings." I...
|
by: jhcorey |
last post by:
We're using a third-party treeview and found that the functionality we
need
works only when we set the web site security to allow Anonymous Access.
We also need the user's network id, which we could get from
System.Web.HttpContext.User.Identity.Name if we don't allow AA.
Is the user's id somehow still accessible in the app even though...
|
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...
|
by: AAOMTim |
last post by:
I have a web project in which I would like to structure my top level
directory to provide a user with anonymous access and a subdirectory for
secure access that uses forms-based authentication. I'm under the impression
that I need 2 web.config files: one in my top level directory for anonymous
access and one in my underlying secure directory...
|
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...
|
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. ...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
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...
| |