<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>旁门左道 &#187; Windows服务</title>
	<atom:link href="http://log.medcl.net/item/tag/windows%e6%9c%8d%e5%8a%a1/feed/" rel="self" type="application/rss+xml" />
	<link>http://log.medcl.net</link>
	<description>记录生活</description>
	<lastBuildDate>Wed, 08 Feb 2012 02:51:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>windows服务和web环境怎样获取相对路径的配置文件</title>
		<link>http://log.medcl.net/item/2010/03/windows-services-and-web-environment-how-to-get-the-relative-path-to-the-configuration-file/</link>
		<comments>http://log.medcl.net/item/2010/03/windows-services-and-web-environment-how-to-get-the-relative-path-to-the-configuration-file/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 08:07:36 +0000</pubDate>
		<dc:creator>medcl</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[web，Configuration]]></category>
		<category><![CDATA[Windows服务]]></category>

		<guid isPermaLink="false">http://log.medcl.net/?p=247</guid>
		<description><![CDATA[string configFile = string.Empty; if &#40;HostingEnvironment.IsHosted&#41; //如果是web环境 &#123; configFile = Path.Combine&#40;HostingEnvironment.ApplicationPhysicalPath, ConfigurationManager.AppSettings&#91;&#34;spring.config&#34;&#93;&#41;; &#125; else &#123; string assemblyFilePath = Assembly.GetExecutingAssembly&#40;&#41;.Location; string assemblyDirPath = Path.GetDirectoryName&#40;assemblyFilePath&#41;; configFile = Path.Combine&#40;assemblyDirPath, ConfigurationManager.AppSettings&#91;&#34;spring.config&#34;&#93;&#41;; &#125; &#160; if &#40;File.Exists&#40;configFile&#41;&#41; &#123; currentContext = new XmlApplicationContext&#40;configFile&#41;; &#125; else &#123; throw new ConfigurationException&#40;&#34;Spring 配置错误！&#34;+configFile&#41;; &#125; Tags: web，Configuration, Windows服务]]></description>
		<wfw:commentRss>http://log.medcl.net/item/2010/03/windows-services-and-web-environment-how-to-get-the-relative-path-to-the-configuration-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

