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

WebRequest to see if Folder exists

I am trying to find out is a folder exists within a share on a server. I can
successfully determine if a file exists within the share, but I can't figure
out how to determine if it's parent folder exists.

This is what I'm trying:

Dim fwrqFolder As FileWebRequest
Dim fwrFolder As FileWebResponse
Dim uriFolder As Uri

Try
Dim strPathName as String = "10.0.0.50/DemoProj/PDQ"
uriFolder = New Uri("file://" & rstrPathName)
fwrqFolder = CType(WebRequest.Create(uriFolder),
FileWebRequest)
fwrFolder = CType(fwrqFolder.GetResponse(),
FileWebResponse)
Catch err As WebException
MsgBox(("WebException: " + err.Message))

The error says: Access to the path "\10.0.0.50\DemoProj\PDQ" is denined.
However, if I add an existing filename to the path it works.

The share is defined as a Virtual Directory with Read, Write, and Directory
Browsing. Directory Security is set to allow Anonymous access.

Any suggestions?

Thanks...Steve
Nov 22 '05 #1
1 1867
Steven,

Did you try the newsgroup

microsoft.public.dotnet.framework.aspnet.security?

Cor

"Steven J. Reed" <St*********@discussions.microsoft.com>
I am trying to find out is a folder exists within a share on a server. I
can
successfully determine if a file exists within the share, but I can't
figure
out how to determine if it's parent folder exists.

This is what I'm trying:

Dim fwrqFolder As FileWebRequest
Dim fwrFolder As FileWebResponse
Dim uriFolder As Uri

Try
Dim strPathName as String = "10.0.0.50/DemoProj/PDQ"
uriFolder = New Uri("file://" & rstrPathName)
fwrqFolder = CType(WebRequest.Create(uriFolder),
FileWebRequest)
fwrFolder = CType(fwrqFolder.GetResponse(),
FileWebResponse)
Catch err As WebException
MsgBox(("WebException: " + err.Message))

The error says: Access to the path "\10.0.0.50\DemoProj\PDQ" is denined.
However, if I add an existing filename to the path it works.

The share is defined as a Virtual Directory with Read, Write, and
Directory
Browsing. Directory Security is set to allow Anonymous access.

Any suggestions?

Thanks...Steve

Nov 22 '05 #2

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

Similar topics

1
by: Steven J. Reed | last post by:
I am trying to find out is a folder exists within a share on a server. I can successfully determine if a file exists within the share, but I can't figure out how to determine if it's parent folder...
4
by: Terry | last post by:
Hello, I am trying to get a response for an .aspx page in my current project (same virtual directory) by using WebRequest.GetResponse but I keep getting a exception with "500 Internal server...
1
by: Steven J. Reed | last post by:
I am trying to find out is a folder exists within a share on a server. I can successfully determine if a file exists within the share, but I can't figure out how to determine if it's parent folder...
2
by: cashdeskmac | last post by:
I am trying to create an XML file in a shared folder on the intranet but keep getting an exception. I am using the Create method of the WebRequest class and calling the response method afterwards....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
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,...
0
jinu1996
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...

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.