01 2013 档案
摘要:public class LogHelper { public static Type type; public static ILog Logger { get { ILog log = log4net.LogManager.GetLogger(type); return log; } } } public class Logger { private log4net.ILog log; public Logger() { StackTrace st = new StackTrace(1, true); StackFrame[] stFrames = st.GetFrames(); Type
阅读全文
摘要:WCF支持多种认证技术,例如Windowns认证、X509证书、Issued Tokens、用户名密码认证等,在跨Windows域分布的系统中,用户名密码认证是比较常用的,要实现用户名密码认证,就必须需要X509证书,用来加密用户名和密码。1. 创建数字证书makecert -sr localmachine -ss My -n CN=ejiyuan -sky exchange -pe -r。2. 创建服务代码[ServiceContract] public interface ICalculator { [OperationContract] double add(double x, ...
阅读全文
摘要:web.config配置如下: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> </configSections> <log4net> <!--错误日志配置--
阅读全文
摘要:C#获取项目程序路径的方法 .asp.net webform用“Request.PhysicalApplicationPath获取站点所在虚拟目录的物理路径,最后包含“\”; 2.c# winform用 A:“Application.StartupPath”:获取当前应用程序所在目录的路径,最后不包含“\”; B:“Application.ExecutablePath ”:获取当前应用程序文件的路径,包含文件的名称; C:“AppDomain.CurrentDomain.BaseDirectory”:获取当前应用程序所在目录的路径,最后包含“\”; D:“System.Threading.T.
阅读全文
摘要:昨天在安装了Ruby 1.9.2 ,并且将其路径加入到Devkit的config.yml中,并且使用ruby dk.rb install安装(不幸的是,没注意安装信息)。。但是依然无法构建native gem。于是重装Ruby,按照devkit的安装说明来安装。还是不正确。 Devkit的安装说明的第4步为Run Installation Scripts:cd <DEVKIT_INSTALL_DIR> from Step 3 above.ruby dk.rb init to generate the config.yml file to be used later in this
阅读全文
摘要:在安装过程中可能遇到的问题:不如出现下面的提示:Installing ri documentation for i18n-0.6.0... unable to convert U+00E4 from UTF-8 to GBK for lib/i18n/tests/interpolation.rb, skipping unable to convert "\xC2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK for lib/i18n.rb, skippingInstalling on Windows没关系,是
阅读全文
摘要:因为最近对火热的ruby感兴趣,故准备搭建ruby开发环境。感受下ruby的强大。在搭建环境的过程中,遇到了一些问题,在下文中已做记录,并奉上个人的解决方案。在开始前啰嗦一句:本人使用环境ruby 1.9.2 ,rails 3.0.9.1、 下载最新版ruby网址如下:http://www.ruby-lang.org/en/downloads/2、 安装ruby下载后直接为exe文件,直接下一步即可。可将[将路径添加到环境变量path中]和[关联ruby文件]两个选项选中。不解释。3、 查看安装结果Windows环境下,cmd中输入:ruby –v 查看ruby版本。如下图:4、 安装rail
阅读全文