使用WIF实现单点登录Part I——Windows Identity Foundation介绍及环境搭建 -摘自网络
上个月有一个星期的时间都在研究asp.net mvc统一身份验证及单点登录的实现。经过了一番的探索,最终决定使用微软的Windows Identity Foundation。但是这东西用的人貌似不多,而且中文资料甚少,所以在测试的过程中走了不少弯路,所以写下这一系列文章,希望能对以后要使用的朋友带来一点帮助。
首先先说一下什么是WIF(Windows Identity Foundation)。由于各种历史原因,身份验证和标识的管理一般都比较无规律可循。在软件里加入“身份验证”功能意味着要在你的代码里混进处理底层任务(如验证用户名和密码,与X509证书或类似的证书打交道等)的代码。这样一来就得对基础架构相当依赖,程序很难移植,除非大范围重写。要改变这种情况,使用基于声明的标识(claims-based identity)可以很好的解决这个问题。这个“基于声明的标识”是神马东西我们留到以后再讲,现在您只要知道有这么个东西就行了。Windows Identity Foundation(WIF)是微软的基于声明标识的协议栈。它是一个新的基础技术,可以帮助.NET开发人员利用基于声明的方法来处理身份验证,授权,定制化以及任何与标识相关的任务,而无需编写任何底层代码。
下面来说说WIF环境的搭建。在这里我就走了不少冤枉路。我的悲催经历就不跟大家分享了,直接介绍各种环境该如何搭建:
1、如果你已经安装了VS2012,那么WIF已经包含在了.Net Framework当中,而且版本为WIF4.5。但是注意,WIF4.5只能用于.net 4.5的工程,如果你的asp.net或MVC项目是基于.net 4.5以下的话(即使你是在VS2012里创建的工程),请继续参考以下方法。
2、如果你安装的是VS2010/VS2008,那么你首先要先安装WIF,然后安装WIF SDK。
如果你用的是windows 8,那么系统已经集成了Windows Identity Foundation 3.5了,只要打开控制面板->程序和功能->打开或关闭Windows功能,找到 Windows Identity Foundation 3.5 ,将前面的勾勾上,然后点击“确定”,完事儿以后点“关闭”即可,如图:

这样WIF 3.5就启用成功了。
如果是其它操作系统,请点击这里,找到对应操作系统的exe文件,下载安装即可。
3、接下来安装WIF的SDK,如果你用的是VS2012,那就不用装任何SDK了,因为它都已经集成在.Net Framework 4.5里了。但是你可能需要安装一个VS的插件。打开VS2012,点击工具->扩展和更新,在左边列表里点击“联机”,然后在右上角的搜索框里输入"identity",点击搜索结果里的“Identity and Access Tool”,点击下载按钮,等待下载并安装完成就可以了。这个工具可以让你很快捷地为Web Application,MVC程序或者WCF服务增加一个本地开发STS(Local Development STS),来测试WIF的功能。这个工具的使用我们留到以后再讲。
如果你用的不是VS2012,请点击这里进行下载并安装相应的SDK。
至此,WIF所需的环境就已经搭建好了,下一步我们来通过一个小例子来说明WIF的工作原理。
这里我用的环境是win7+vs2012,vs2010+WIF3.5/4.0的情况请参见这篇文章。
打开VS2012,新建一个基于.net framework4.5的MVC4的工程,取名为WIFTutorial。如下图:

在弹出的“新ASP.NET MVC 4项目”对话框中直接点“确定”。
项目新建完毕后,在“解决方案资源管理器”中,项目名称上点右键,然后选择“Identity and Accee...”,如图:

在“Providers”页签里选择“Use the Local Development STS to test your application”。此时”Local Development STS"页签由不可用变为可用。切换到该页签,将Test claims to issue表格里的第一行的Value列改为“ojlovecd”,如图:

点击“OK”,这个工具将会更改你的web.config文件,我们在解决方案资源管理器里打开web.config看看:
- <?xml version="1.0" encoding="utf-8"?>
- <!--
- 有关如何配置 ASP.NET 应用程序的详细信息,请访问
- http://go.microsoft.com/fwlink/?LinkId=169433
- -->
- <configuration>
- <configSections>
- <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
- <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
- <span style="color: rgb(255, 0, 0);"><section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
- <section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /></span>
- </configSections>
- <connectionStrings>
- <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-WIFTutorial-20130220231745;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-WIFTutorial-20130220231745.mdf" providerName="System.Data.SqlClient" />
- </connectionStrings>
- <appSettings>
- <add key="webpages:Version" value="2.0.0.0" />
- <add key="webpages:Enabled" value="false" />
- <add key="PreserveLoginUrl" value="true" />
- <add key="ClientValidationEnabled" value="true" />
- <add key="UnobtrusiveJavaScriptEnabled" value="true" />
- <span style="color: rgb(255, 0, 0);"><add key="ida:FederationMetadataLocation" value="http://localhost:14419/wsFederationSTS/FederationMetadata/2007-06/FederationMetadata.xml" />
- <add key="ida:Issuer" value="http://localhost:14419/wsFederationSTS/Issue" />
- <add key="ida:ProviderSelection" value="localSTS" /></span>
- </appSettings>
- <span style="color: rgb(255, 0, 0);"><location path="FederationMetadata">
- <system.web>
- <authorization>
- <allow users="*" />
- </authorization>
- </system.web>
- </location></span>
- <system.web>
- <span style="color: rgb(255, 0, 0);"><authorization>
- <deny users="?" />
- </authorization></span>
- <authentication mode="None" />
- <compilation debug="true" targetFramework="4.5" />
- <httpRuntime targetFramework="4.5" requestValidationMode="4.5" />
- <!--Commented by Identity and Access VS Package-->
- <!--<authentication mode="Forms"><forms loginUrl="~/Account/Login" timeout="2880" /></authentication>-->
- <pages>
- <namespaces>
- <add namespace="System.Web.Helpers" />
- <add namespace="System.Web.Mvc" />
- <add namespace="System.Web.Mvc.Ajax" />
- <add namespace="System.Web.Mvc.Html" />
- <add namespace="System.Web.Optimization" />
- <add namespace="System.Web.Routing" />
- <add namespace="System.Web.WebPages" />
- </namespaces>
- </pages>
- </system.web>
- <system.webServer>
- <validation validateIntegratedModeConfiguration="false" />
- <handlers>
- <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
- <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
- <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
- <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
- <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
- <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
- </handlers>
- <modules>
- <remove name="FormsAuthentication" />
- <add name="WSFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
- <add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
- </modules>
- </system.webServer>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
- <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
- <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
- <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
- <entityFramework>
- <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
- <parameters>
- <parameter value="v11.0" />
- </parameters>
- </defaultConnectionFactory>
- </entityFramework>
- <system.identityModel>
- <identityConfiguration>
- <audienceUris>
- <add value="http://localhost:8007/" />
- </audienceUris>
- <issuerNameRegistry type="System.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <trustedIssuers>
- <add thumbprint="9B74CB2F320F7AAFC156E1252270B1DC01EF40D0" name="LocalSTS" />
- </trustedIssuers>
- </issuerNameRegistry>
- <certificateValidation certificateValidationMode="None" />
- </identityConfiguration>
- </system.identityModel>
- <span style="color: rgb(255, 0, 0);"><system.identityModel.services>
- <federationConfiguration>
- <cookieHandler requireSsl="false" />
- <wsFederation passiveRedirectEnabled="true" issuer="http://localhost:14419/wsFederationSTS/Issue" realm="http://localhost:8007/" requireHttps="false" />
- </federationConfiguration>
- </system.identityModel.services></span>
- </configuration>
<?xml version="1.0" encoding="utf-8"?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</configSections>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-WIFTutorial-20130220231745;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-WIFTutorial-20130220231745.mdf" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="ida:FederationMetadataLocation" value="http://localhost:14419/wsFederationSTS/FederationMetadata/2007-06/FederationMetadata.xml" />
<add key="ida:Issuer" value="http://localhost:14419/wsFederationSTS/Issue" />
<add key="ida:ProviderSelection" value="localSTS" />
</appSettings>
<location path="FederationMetadata">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<system.web>
<authorization>
<deny users="?" />
</authorization>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" requestValidationMode="4.5" />
<!--Commented by Identity and Access VS Package-->
<!--<authentication mode="Forms"><forms loginUrl="~/Account/Login" timeout="2880" /></authentication>-->
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<modules>
<remove name="FormsAuthentication" />
<add name="WSFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
<add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
</modules>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
<system.identityModel>
<identityConfiguration>
<audienceUris>
<add value="http://localhost:8007/" />
</audienceUris>
<issuerNameRegistry type="System.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<trustedIssuers>
<add thumbprint="9B74CB2F320F7AAFC156E1252270B1DC01EF40D0" name="LocalSTS" />
</trustedIssuers>
</issuerNameRegistry>
<certificateValidation certificateValidationMode="None" />
</identityConfiguration>
</system.identityModel>
<system.identityModel.services>
<federationConfiguration>
<cookieHandler requireSsl="false" />
<wsFederation passiveRedirectEnabled="true" issuer="http://localhost:14419/wsFederationSTS/Issue" realm="http://localhost:8007/" requireHttps="false" />
</federationConfiguration>
</system.identityModel.services>
</configuration>
其中标红色的部分即为工具自动生成的。同时此工具还会在你的程序跟目录下新建了一个名为FederationMetadata的目录,通过在解决方案资源管理器中点击“显示所有文件”按钮就可以看到了。
然后我们按F5,结果报错了,如图:

看提示,是因为要启动LocalSTS必须要用管理员身份来运行。好吧,关掉VS,以管理员身份再次打开,载入项目,再次按F5运行程序,此时看到右下角托盘处LocalSTS已经运行了,而打开的主页中,右上角显示用户ojlovecd已经处于登录状态。


这一连串操作到底都干了什么?
首先,刚才已经说到,Identity and Access Tool先修改了web.config,增加了WIF要用到的一些配置信息,在程序启动的时候,首先一并启动LocalSTS,这个LocalSTS起什么作用?由于web.config中配置了authorization节点,拒绝匿名用户访问,因此在你的程序运行起来以后,对程序的请求信息被重定向到LocalSTS,向LocalSTS请求身份信息,LocalSTS收到请求后,返回身份信息。那么返回的身份信息怎么来的?没错,就是在Identity and Access Tool工具里的第三个页签里配置的。
至此,我们没有编写任何代码,就已经实现了一个很简单的身份验证功能,关于此例子的详细讲解,以及我们要重点介绍的WIF原理及单点登录的实现,我们将留到下面的文章进行讲解。
使用WIF实现单点登录Part I——Windows Identity Foundation介绍及环境搭建 -摘自网络的更多相关文章
- 使用WIF实现单点登录Part I——Windows Identity Foundation介绍及环境搭建
首先先说一下什么是WIF(Windows Identity Foundation).由于各种历史原因,身份验证和标识的管理一般都比较无规律可循.在软件里加入“身份验证”功能意味着要在你的代码里混进处理 ...
- 使用WIF实现单点登录Part II —— Windows Identity Foundation基本原理
在上一篇文章中,我们已经使用WIF构建了一个基于MVC4的简单的身份验证程序,在这篇文章里,我们将探讨一下到底什么是WIF,以及它的工作原理.然后在下一篇文章开始,我们将实际操作,实现单点登录功能. ...
- 使用WIF实现单点登录Part II —— Windows Identity Foundation基本原理 -摘自网络
在上一篇文章中,我们已经使用WIF构建了一个基于MVC4的简单的身份验证程序,在这篇文章里,我们将探讨一下到底什么是WIF,以及它的工作原理.然后在下一篇文章开始,我们将实际操作,实现单点登录功能. ...
- 使用WIF实现单点登录Part III —— 正式实战
我们接下来的demo将包括以下的工程: SiteA —— 基于.net framework 4.5的MVC 4程序,使用WIF 4.5的SDK,第一个RP SiteB —— 基于.net framew ...
- 使用WIF实现单点登录Part III —— 正式实战 -摘自网络
经过前两篇文章,估计大家对WIF已经有比较充分的认识了,估计大家在经过了枯燥的理论以后,肯定是摩拳擦掌赶紧付诸于行动了.没办法,咱们程序员就是这个毛病.那好吧,我也不那么多废话了,直接进入正题吧. 我 ...
- ABP集成WIF实现单点登录
ABP集成WIF实现单点登录 参考 ojlovecd写了三篇关于WIF文章. 使用WIF实现单点登录Part III —— 正式实战 使用WIF的一些开源示例. https://github.com/ ...
- Installing Windows Identity Foundation on Windows 8 - The Certificate for the signer of the message is invalid or not found.
Just a very quick note here, in case you’re struggling to get Windows Identity Foundation installed ...
- windows下php+apache+mysql环境搭建
在Windows 7下进行PHP环境搭建,首先需要下载PHP代码包和Apache与Mysql的安装软件包. PHP版本:php-5.3.2-Win32-VC6-x86,VC9是专门为IIS定制的,VC ...
- [转]MonkeyRunner在Windows下的Eclipse开发环境搭建步骤(兼解决网上Jython配置出错的问题)
MonkeyRunner在Windows下的Eclipse开发环境搭建步骤(兼解决网上Jython配置出错的问题) 网上有一篇shangdong_chu网友写的文章介绍如何在Eclipse上配置M ...
随机推荐
- 重置mysql密码
如何修改mysql root密码 忘记MySQL ROOT密码是在MySQ使用中很常见的问题,可是有很多朋友并不会重置ROOT密码,那叫苦啊,特写此文章与大家交流: 1.编辑MySQL的配置文件:my ...
- php smarty 配置四个存放目录
require("Smarty.class.php"); $smarty = new Smarty(); $smarty -> template_dir = "./ ...
- C#中使用正则表达式提取超链接地址的集中方法(转)
一般在做爬虫或者CMS的时候经常需要提取 href链接或者是src地址.此时可以使用正则表达式轻松完成. Regex reg = new Regex(@"(?is)<a[^>]* ...
- ANDROID_MARS学习笔记_S01原始版_023_MP3PLAYER004_同步显示歌词
一.流程分析 1.点击播放按钮,会根据lrc名调用LrcProcessor的process()分析歌词文件,得到时间队列和歌词队列 2.new一个hander,把时间队列和歌词队列传给自定义的线程类U ...
- RichEdit 各个版本介绍
RichEdit是开发中经常使用到的控件,其版本自1.0起,历经好几年,好几次的更新,在此引用一篇介绍RichEdit版本的博文(http://blogs.msdn.com/b/murrays/arc ...
- MySQL can’t specify target table for update in FROM clause
翻译:MySQL不能指定更新的目标表在FROM子句 源SQL语句: delete from t_official_sys_user where USER_NAME IN(SELECT USER_NAM ...
- Oracle Form 特殊的默认值 $$variables$$
Oracle Forms 提供了六个特殊的系统变量,均为提供日期和时间的信息的变量: •$$DATE$$ •$$TIME$$ •$$DATETIME$$ •$$DBDATE$$ •$$DBTIME$$ ...
- Webform——服务器控件与客户端控件
Webform,即BS,浏览器应用. 关于服务器和客户端,在Webform 中, 服务器就相当于后台(也就是编辑C#代码的地方), 客户端相当于前台(也就是Html页面). 用法: ①如果想在服务器 ...
- BZOJ_1614_ [Usaco2007_Jan]_Telephone_Lines_架设电话线_(二分+最短路_Dijkstra/Spfa)
描述 http://www.lydsy.com/JudgeOnline/problem.php?id=1614 分析 类似POJ_3662_Telephone_Lines_(二分+最短路) Dijks ...
- stuts2的上传(转载)
Struts2本身并没提供上传的组件,我们可以通过调用上传框架来实现文件的上传. 一.配置上传解析器 首先要配置项目的框架,也就是倒导入"struts2- core-2.2.1.jar&qu ...