我有下面的方法在我的DLL類庫是否可以將Appconfig的值作爲Object調用?
private void Download(string filename)
{
//am calling this value from appconfig
string ftpserverIp = System.Configuration.ConfigurationManager.AppSettings["ServerAddress"];
// somecode to download the file
}
Private void Upload(string filename)
{
string ftpserverIp = System.Configuration.ConfigurationManager.AppSettings["ServerAddress"];
// somecode to upload the file
}
就像那個我從AppConfig中爲我所有的方法讓所有的價值,這是任何有效的方法來調用的AppConfig值?
哇!真棒所有你的輸入,我會去私人getter。 – Usher 2012-02-28 02:16:58