1、右键网站添加虚拟目录:
2、编辑虚拟目录:
编辑虚拟目录对话框中的“物理路径(P)”中可以填写远程主机,比如:\\192.168.45.200\share,然后点击“链接为“按钮,如果点击确定出现”指定密码无效,请键入新密码“的提示框,说明密码有误,可添加域名尝试,如:domain\zhangsan。保证真实目录对输入的用户有权限操作。然后一路点击确定,回到”编辑虚拟目录“界面。
3、测试连接
点击”测试设置“按钮,出现如下界面,结果均为绿色,目录设置成功。
4、修改配置文件
在<system.web>节点中添加你刚刚输入的用户信息<identityimpersonate="true"userName="tech"password="password"/>,配置完成的XML如下:
1. <?xmlversion="1.0"encoding="UTF-8"?>
2. <!--
3. 有关如何配置ASP.NET应用程序的详细信息,请访问
4. http://go.microsoft.com/fwlink/?LinkId=169433
5. -->
6. <configuration>
7. <connectionStrings>
8. <addname="ApplicationServices"connectionString="server=192.168.123.123;database=database;uid=uid;pwd=
password"providerName="System.Data.SqlClient"/>
9. </connectionStrings>
10. <system.web>
11. <identityimpersonate="true"userName="tech"password="password"/>
12. <!--错误页-->
13. <customErrorsmode="On"defaultRedirect="error.htm"/>
14.
15. <sessionStatemode="InProc"timeout="120"/>
16. <compilationdebug="true"targetFramework="4.0"/>
17. <authenticationmode="Forms">
18. <formsloginUrl="~/Account/Login.aspx"timeout="2880"/>
19. </authentication>
20. <membership>
21. <providers>
22. <clear/>
23. <addname="AspNetSqlMembershipProvider"type="System.Web.Security.SqlMembershipProvider"connectionStringName
="ApplicationServices"enablePasswordRetrieval="false"enablePasswordReset="true"requiresQuestionAndAnswer=
"false"requiresUniqueEmail="false"maxInvalidPasswordAttempts="5"minRequiredPasswordLength="6"minRequired
NonalphanumericCharacters="0"passwordAttemptWindow="10"applicationName="/"/>
24. </providers>
25. </membership>
26. <profile>
27. <providers>
28. <clear/>
29. <addname="AspNetSqlProfileProvider"type="System.Web.Profile.SqlProfileProvider"connectionStringName="
ApplicationServices"applicationName="/"/>
30. </providers>
31. </profile>
32. <roleManagerenabled="false">
33. <providers>
34. <clear/>
35. <addname="AspNetSqlRoleProvider"type="System.Web.Security.SqlRoleProvider"connectionStringName="
ApplicationServices"applicationName="/"/>
36. <addname="AspNetWindowsTokenRoleProvider"type="System.Web.Security.WindowsTokenRoleProvider"
applicationName="/"/>
37. </providers>
38. </roleManager>
39. <pagescontrolRenderingCompatibilityVersion="3.5"clientIDMode="AutoID"/>
40. <httpRuntimemaxRequestLength="300000000"executionTimeout="120"/>
41. </system.web>
42. <system.webServer>
43. <modulesrunAllManagedModulesForAllRequests="true"/>
44. <security>
45. <requestFiltering>
46. <requestLimitsmaxAllowedContentLength="1000000000"/>
47. </requestFiltering>
48. </security>
49. <staticContent>
50. <removefileExtension=".flv"/>
51. <mimeMapfileExtension=".mp4"mimeType="mp4-application/octet-stream"/>
52. <mimeMapfileExtension=".flv"mimeType="video/x-flv"/>
53. <mimeMapfileExtension=".vob"mimeType="video/quicktime"/>
54. </staticContent>
55. </system.webServer>
56. <appSettings>
57. <addkey="ffmpeg"value="F:\website\videoTool\ffmpeg\bin\ffmpeg.exe"/>
58. <addkey="picSnapSize"value="100*100"/>
59. <addkey="exceptDeparts"value="中心/技术部"/>
60. </appSettings>
61. </configuration>