当前位置: 代码迷 >> PB >> webform程序打开服务器上excle文件,IE提示输入用户名密码,怎么解决
  详细解决方案

webform程序打开服务器上excle文件,IE提示输入用户名密码,怎么解决

热度:168   发布时间:2016-04-29 09:32:57.0
webform程序打开服务器上excle文件,IE提示输入用户名密码,如何解决?
webform程序打开服务器上excle文件,老是弹出输入用户名,密码的提示框,输入服务器的用户名密码才可以正常打开,服务器已经开启了guest用户,并且允许匿名登录的,求教大家了!!

------解决方案--------------------
不是guest,而是ASPNET (IIS 5.0), IIS_WPG (IIS 6.0), or IIS_IUSRS (IIS 7.0) 
要有相应目录的完全控制权限,顺便说下,你不能用windows的简单共享
------解决方案--------------------
Creating permanent user accounts
Permanent user accounts are disabled by default. After a Web Forms application is successfully deployed, the IIS server administrator can use the following procedure to set up permanent user accounts. This procedure uses the default ASP.NET membership provider and data source assignment, although a note in the procedure describes a required change to the web.config file when you use a nondefault connection string.

 To create permanent user accounts:

Run aspnet_regsql from a DOS command prompt window. 

This starts the ASP.NET SQL Server Setup wizard. 

You can enter Aspnet_regsql /? at the command line to obtain a list of optional parameters for SQL Server or SQL Server Express that you can use to bypass the wizard. If you are using a local SQL Server database, for example, you can enter aspnet_regsql -S (local) -E -A m, where -S (local) indicates that the server is local, -E indicates that the connection uses Windows Authentication, and -A m adds the membership feature.

Use the ASP.NET SQL Server Setup wizard to create the user database.

In the wizard, you can enter .\SQLEXPRESS as the server name. This is the default name for the local server as defined in the machine.config file. The wizard should give you a success message.

In a text editor, modify the web.config file in the virtual root directory for your deployed Web Forms application (typically, C:\Inetpub\wwwroot\applicationName) to remove comment tags (<!-- and -->) from the following lines: 


 <!-- <roleManager enabled="true" /> -->
...
<!-- <add name="AspNetSqlMembershipProvider"
...
passwordStrengthRegularExpression=""/> -->

These lines should now appear in the web.config file as: 


 <roleManager enabled="true" />
...
<add name="AspNetSqlMembershipProvider"
...
passwordStrengthRegularExpression=""/> 

 If you are using a nondefault database You can change the connectionStringName parameter assignment in the uncommented lines to a value other than LocalSqlServer if you modified the connection string in the machine.config file, or if you added a connection string in the application web.config file. For example, if you named a connection string as MySqlServer, you should change the connectionStringName parameter value to MySqlServer.

Make sure that the appropriate user or user group (ASPNET for IIS 5, IIS_WPG for IIS 6, or IIS_IUSRS for IIS 7) has write authority for the virtual root directory of your deployed Web Forms application.

The next step in this procedure creates the App_Data directory and saves database files to this directory. However, it cannot do this if the ASPNET user (Windows XP), the IIS_WPG user group (Windows 2003), or the IIS_IUSRS user group (Windows Vista) does not have write authority for the Web Forms virtual root directory. 

If you proceed to the next step without modifying write permissions, you might get an error page indicating that you do not have write authority for this directory. The error page also explains how to grant write authority for the directory.

Open the UsersInit.aspx file for the Web Forms application in a Web browser.

The full URL for this file is typically http://ServerName/ApplicationName/UsersInit.aspx. When you open this file in a Web browser, the App_Data directory is created under the application virtual root directory and the permanent accounts database is created with the following entries:
  相关解决方案