1
我有一個在II6中託管的wcf服務。該服務使用服務器的文件系統來保存信息。現在,持久性目錄被硬編碼爲F:\ PM。 如何使用配置文件來存儲此目錄?如何使用表單應用程序訪問此文件以修改它?如何管理IIS6託管的WCF服務的自定義設置?
我有一個在II6中託管的wcf服務。該服務使用服務器的文件系統來保存信息。現在,持久性目錄被硬編碼爲F:\ PM。 如何使用配置文件來存儲此目錄?如何使用表單應用程序訪問此文件以修改它?如何管理IIS6託管的WCF服務的自定義設置?
您會將信息在web.config文件
<appSettings>
<add key="Directory" value="F:\PM" />
</appSettings>
要讀值出配置文件
string directoryLocation = ConfigurationSettings.AppSettings["Directory"];
的更新從WinForms應用程序的文件,你可以閱讀並更新文件。