访问虚拟目录。 [英] Access Virtual Directory.

查看:72
本文介绍了访问虚拟目录。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我在IIS上创建了虚拟目录。

Alias Name =" ABC"
然后我创建简单的网站,只有一个按钮。

当执行代码后点击该按钮时:

Dim myFile As StreamReader = File.OpenText(" / abc / MyFile.txt")

Dim line As String = myFile.ReadLine

Do while not line Is String.Empty

Dim XXX As String = line

循环

myFile.Close()


这是我收到的错误信息:


找不到路径的一部分C:\ abc \ MyFile.txt。


我做错了什么?

Hi there,

I created virtual directory on IIS.
Alias Name = "ABC"
Then I created simple web site which has just one button.
When clicking on that button following code is executed:
Dim myFile As StreamReader = File.OpenText("/abc/MyFile.txt")
Dim line As String = myFile.ReadLine
Do While Not line Is String.Empty
Dim XXX As String = line
Loop
myFile.Close()

This is the error message I am getting:

Could not find a part of the path "C:\abc\MyFile.txt".

What am I doing wrong?

推荐答案

该文件夹是否具有ASP.NET工作进程的访问权限?


- < br $>
Swanand Mokashi

微软认证解决方案开发人员(.NET) - 早期成就者

Microsoft认证应用程序开发人员r(.NET)

http://www.dotnetgenerics.com/

DotNetGenerics.com - 关于Microsoft .NET的一切事物

技术......

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/

股票之家行情,当天报价和星座网络服务

< j _ **** @ hotmail.com>在消息中写道

新闻:11 ********************** @ j73g2000cwa.googlegr oups.com ...
Does the folder have access permissions for the ASP.NET worker process ?

--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
<j_****@hotmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...
你好,

我在IIS上创建了虚拟目录。
Alias Name =" ABC"
然后我创建了一个只有一个按钮的简单网站。<执行代码后单击该按钮时:

Dim myFile As StreamReader = File.OpenText(" /abc/MyFile.txt")
Dim line As String = myFile .ReadLine
Do While Not line是String.Empty
Dim XXX As String = line
循环
myFile.Close()

这是错误我得到的消息:

找不到路径的一部分C:\ abc \ MyFile.txt。

我做错了什么?
Hi there,

I created virtual directory on IIS.
Alias Name = "ABC"
Then I created simple web site which has just one button.
When clicking on that button following code is executed:
Dim myFile As StreamReader = File.OpenText("/abc/MyFile.txt")
Dim line As String = myFile.ReadLine
Do While Not line Is String.Empty
Dim XXX As String = line
Loop
myFile.Close()

This is the error message I am getting:

Could not find a part of the path "C:\abc\MyFile.txt".

What am I doing wrong?



你想看看Server.MapPath


< j _ **** @ hotmail .COM>在消息中写道

新闻:11 ********************** @ j73g2000cwa.googlegr oups.com ...
You''ll want to check out Server.MapPath

<j_****@hotmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...
你好,

我在IIS上创建了虚拟目录。
Alias Name =" ABC"
然后我创建了一个只有一个按钮的简单网站。<执行代码后单击该按钮时:

Dim myFile As StreamReader = File.OpenText(" /abc/MyFile.txt")
Dim line As String = myFile .ReadLine
Do While Not line是String.Empty
Dim XXX As String = line
循环
myFile.Close()

这是错误我得到的消息:

找不到路径的一部分C:\ abc \ MyFile.txt。

我做错了什么?
Hi there,

I created virtual directory on IIS.
Alias Name = "ABC"
Then I created simple web site which has just one button.
When clicking on that button following code is executed:
Dim myFile As StreamReader = File.OpenText("/abc/MyFile.txt")
Dim line As String = myFile.ReadLine
Do While Not line Is String.Empty
Dim XXX As String = line
Loop
myFile.Close()

This is the error message I am getting:

Could not find a part of the path "C:\abc\MyFile.txt".

What am I doing wrong?



To Swanand Mokashi

我该怎么办?我将aspwp用户添加到该文件夹​​但问题仍然是

相同...

给Jeff

这就是我做的:

Dim x As String = Server.MapPath(" /abc/MyFile.txt")

然后当我检查x时它是C:\ Inetpub \ www.root \ abc\myFile.txt ...

To Swanand Mokashi
How do I do it? I added aspwp user to that folder but problem is still
the same...
To Jeff
This is what I did:
Dim x As String = Server.MapPath("/abc/MyFile.txt")
Then when I check x it is C:\Inetpub\wwwroot\abc\myFile.txt...


这篇关于访问虚拟目录。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆