无法写入文件夹 [英] Can't write to folder

查看:153
本文介绍了无法写入文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨和TIA。运行VS2005和IIS7.0。我有一个程序将

文件复制到我的Web应用程序中的文件夹。当我从VS运行项目时,

运行正常。我是IE的默认查看器。但当我直接输入

IE时( http:// localhost / Menu .aspx )当我尝试打开连接时它会爆炸

因为文件没有被复制到文件夹中。任何想法/建议都是值得赞赏的。


Dim xConnStr As String =" Provider = Microsoft.Jet.OLEDB.4.0;" _

& 数据源= &安培; Server.MapPath(" WSMDDT_Old\MDB_Temp \"& strFile)

&英寸;" &安培; _

"扩展属性="" Excel 8.0; HDR = TRUE; IMEX = 1"""


''创建你的excel连接对象使用连接字符串

Dim objXConn As New OleDbConnection(xConnStr)

objXConn.Open()

-


Reggie

Hi And TIA. Running VS2005 and IIS7.0. I have a procedure that copies a
file to a folder in my web application. When I run the project from VS it
runs fine . I''m usin IE as default viewer. But when I type it directly into
IE (http://localhost/Menu.aspx) it bombs when I try to open the connection
cause the file doesn''t get copied to the folder. Any thoughts/advice is
appreciated.

Dim xConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & Server.MapPath("WSMDDT_Old\MDB_Temp\" & strFile)
& ";" & _
"Extended Properties=""Excel 8.0;HDR=TRUE;IMEX=1"""

'' create your excel connection object using the connection string
Dim objXConn As New OleDbConnection(xConnStr)
objXConn.Open()
--

Reggie

推荐答案

10月18日,11:02 * am,Reggie < No_Spam_chief123 ... @ yahoo.comwrote:
On Oct 18, 11:02*am, "Reggie" <No_Spam_chief123...@yahoo.comwrote:

嗨和TIA。 *运行VS2005和IIS7.0。 *我有一个程序将

文件复制到我的Web应用程序中的文件夹。 *当我从VSit运行项目时

运行正常。我是IE的默认查看器。 *但是当我直接输入

IE时( http:// localhost / Menu .aspx )当我尝试打开连接时它会爆炸

因为文件没有被复制到文件夹中。 *任何想法/建议是

赞赏。


* * * * Dim xConnStr As String =" Provider = Microsoft.Jet.OLEDB.4.0;" ; _

* * * *& 数据源= &安培; Server.MapPath(" WSMDDT_Old\MDB_Temp \"& strFile)

&英寸;" &安培; _

* * * *"扩展属性="" Excel 8.0; HDR = TRUE; IMEX = 1"""


* * * *''使用连接字符串创建你的excel连接对象

* * * * Dim objXConn As New OleDbConnection(xConnStr)

* * * * objXConn.Open( )


-


Reggie
Hi And TIA. *Running VS2005 and IIS7.0. *I have a procedure that copies a
file to a folder in my web application. *When I run the project from VSit
runs fine . I''m usin IE as default viewer. *But when I type it directlyinto
IE (http://localhost/Menu.aspx) it bombs when I try to open the connection
cause the file doesn''t get copied to the folder. *Any thoughts/advice is
appreciated.

* * * * Dim xConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" _
* * * * & "Data Source=" & Server.MapPath("WSMDDT_Old\MDB_Temp\" & strFile)
& ";" & _
* * * * "Extended Properties=""Excel 8.0;HDR=TRUE;IMEX=1"""

* * * * '' create your excel connection object using the connection string
* * * * Dim objXConn As New OleDbConnection(xConnStr)
* * * * objXConn.Open()

--

Reggie



当您在其中运行代码时你在你自己的用户

帐户下运行它,这是有效的。 IIS使用名为IIS_IUSRS

(IUSR帐户)的内置组,似乎此帐户对

目标文件夹没有任何权限。向IIS_USRS提供您希望它们能够写入的

文件夹的写访问权限。这可以通过

在Windows资源管理器中导航到您的文件夹,右键单击

文件夹并选择安全选项卡来完成。

When you run your code within VS you run it under your own user
account and this works. IIS uses a built-in group named IIS_IUSRS
(IUSR account) and it seems that this account has no rights on the
destination folder. Give to the IIS_USRS the write access to the
folder you want them to be able to write to. This can be done by
navigating to your folder in Windows Explorer, right-clicking on the
folder and selecting the Security Tab.


IIS_IUSRS具有写入该文件夹的所有权限。此外,网络

服务和我已经给予完全权利的许多其他人(只是为了尝试并获得它工作的
),还没有任何工作。我会继续努力。


-


Reggie

" Alexey Smirnov" < al ************ @ gmail.comwrote in message

news:2c ****************** **************** @ v72g2000 hsv.googlegroups.com ...

10月18日上午11:02,Reggie < No_Spam_chief123 ... @ yahoo.comwrote:
IIS_IUSRS has all the permissions to write to the folder. Also, Network
Services and many others I have given full rights to (only to try and get it
to work), Nothing has worked yet. I''ll keep trying.

--

Reggie
"Alexey Smirnov" <al************@gmail.comwrote in message
news:2c**********************************@v72g2000 hsv.googlegroups.com...
On Oct 18, 11:02 am, "Reggie" <No_Spam_chief123...@yahoo.comwrote:

嗨和TIA。运行VS2005和IIS7.0。我有一个程序将

文件复制到我的Web应用程序中的文件夹。当我从VS运行项目时,

运行正常。我是IE的默认查看器。但是当我直接输入

进入

IE( http://localhost/Menu.aspx )当我尝试打开连接时它会爆炸

因为文件没有被复制到文件夹中。任何想法/建议都是值得赞赏的。


Dim xConnStr As String =" Provider = Microsoft.Jet.OLEDB.4.0;" _

& 数据源= &安培; Server.MapPath(" WSMDDT_Old\MDB_Temp \"& strFile)

&英寸;" &安培; _

"扩展属性="" Excel 8.0; HDR = TRUE; IMEX = 1"""


''创建你的excel连接对象使用连接字符串

Dim objXConn As New OleDbConnection(xConnStr)

objXConn.Open()


-


Reggie
Hi And TIA. Running VS2005 and IIS7.0. I have a procedure that copies a
file to a folder in my web application. When I run the project from VS it
runs fine . I''m usin IE as default viewer. But when I type it directly
into
IE (http://localhost/Menu.aspx) it bombs when I try to open the connection
cause the file doesn''t get copied to the folder. Any thoughts/advice is
appreciated.

Dim xConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & Server.MapPath("WSMDDT_Old\MDB_Temp\" & strFile)
& ";" & _
"Extended Properties=""Excel 8.0;HDR=TRUE;IMEX=1"""

'' create your excel connection object using the connection string
Dim objXConn As New OleDbConnection(xConnStr)
objXConn.Open()

--

Reggie



当您在VS中运行代码时,您可以在自己的用户下运行

帐户,这是有效的。 IIS使用名为IIS_IUSRS

(IUSR帐户)的内置组,似乎此帐户对

目标文件夹没有任何权限。向IIS_USRS提供您希望它们能够写入的

文件夹的写访问权限。这可以通过

在Windows资源管理器中导航到您的文件夹,右键单击

文件夹并选择安全选项卡来完成。

When you run your code within VS you run it under your own user
account and this works. IIS uses a built-in group named IIS_IUSRS
(IUSR account) and it seems that this account has no rights on the
destination folder. Give to the IIS_USRS the write access to the
folder you want them to be able to write to. This can be done by
navigating to your folder in Windows Explorer, right-clicking on the
folder and selecting the Security Tab.


10月18日,10:26 * pm,Reggie < No_Spam_chief123 ... @ yahoo.comwrote:
On Oct 18, 10:26*pm, "Reggie" <No_Spam_chief123...@yahoo.comwrote:

IIS_IUSRS具有写入该文件夹的所有权限。 *此外,网络

服务和我已经给予完全权利的许多其他人(只有尝试和getit

才能工作),*什么都没有效果。 *我会继续努力。
IIS_IUSRS has all the permissions to write to the folder. *Also, Network
Services and many others I have given full rights to (only to try and getit
to work), *Nothing has worked yet. *I''ll keep trying.



也许还有另外一个问题。您是否收到有关

写入权限不足的错误,或者代码无效?
?如果是后者,你可以发布代码吗?我没有看到

在你之前发送的代码片段中复制文件的任何内容


Maybe there is another problem then. Did you get an error about
insufficient write permissions, or the code is not working as
expected? if the latter is the case can you post the code? I don''t see
anything what copies a file in the snippet you sent earlier


Dim xConnStr As String =" Provider = Microsoft.Jet.OLEDB.4.0;" _

& 数据源= &安培; Server.MapPath(" WSMDDT_Old\MDB_Temp \"& strFile)

&英寸;" &安培; _

"扩展属性="" Excel 8.0; HDR = TRUE; IMEX = 1"""


''创建你的excel连接对象使用连接字符串

Dim objXConn As New OleDbConnection(xConnStr)

objXConn.Open()
Dim xConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & Server.MapPath("WSMDDT_Old\MDB_Temp\" & strFile)
& ";" & _
"Extended Properties=""Excel 8.0;HDR=TRUE;IMEX=1"""

'' create your excel connection object using the connection string
Dim objXConn As New OleDbConnection(xConnStr)
objXConn.Open()


这篇关于无法写入文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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