应用Castle Monorail做东西,现在遇到了一个问题,现在想给数据库连接字符串加密。但是不知道进行加密?
1:首先:
<castle>
<properties>
<nhConnectionString>XXXXXXXXXXXx</nhConnectionString>
</properties>
<include uri="file://Config/facilities_mysql.config" /> <include uri="file://Config/controllers.config" />
</castle>
<facility id="rails.facility"
type="Castle.MonoRail.WindsorExtension.RailsFacility, Castle.MonoRail.WindsorExtension" />
<facility id="transaction"
type="Castle.Facilities.AutomaticTransactionManagement.TransactionFacility, Castle.Facilities.AutomaticTransactionManagement" />
<facility id="loggingfacility" type="Castle.Facilities.Logging.LoggingFacility, Castle.Facilities.Logging" loggingApi="Log4net" configFile="logging.config" />
<facility id="nhibernatefacility"
type="Castle.Facilities.NHibernateIntegration.NHibernateFacility, Castle.Facilities.NHibernateIntegration" isWeb="true">
<factory id="sessionFactory1" >
<settings>
<item key="hibernate.connection.connection_string">#{nhConnectionString}</item>
<item key="hibernate.connection.provider">NHibernate.Connection.DriverConnectionProvider</item>
<item key="hibernate.connection.driver_class">NHibernate.Driver.MySqlDataDriver</item>
<item key="hibernate.dialect">NHibernate.Dialect.MySQLDialect</item>
</settings>
2:接下来在程序中,如何应用加密后的数据库连接字符串我就不会了,请高手指教。