您好,小弟使用了這篇文章的讀寫web.config的語法
但是在寫入時在config.Save(); 這一行發生錯誤
可以請問怎麼解決嗎 感謝您 ^^
附上錯誤訊息:
Message="無法將組態儲存到檔案 'D:\\2005WebSite\\SCM\\Manager\\web.config'。"
Source="System.Configuration"
BareMessage="無法將組態儲存到檔案 'D:\\2005WebSite\\SCM\\Manager\\web.config'。"
Line=0
StackTrace:
於 System.Configuration.Internal.WriteFileContext.ReplaceFile(String Source, String Target)
於 System.Configuration.Internal.WriteFileContext.Complete(String filename, Boolean success)
於 System.Configuration.Internal.InternalConfigHost.StaticWriteCompleted(String streamName, Boolean success, Object writeContext, Boolean assertPermissions)
於 System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.WriteCompleted(String streamName, Boolean success, Object writeContext, Boolean assertPermissions)
於 System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.WriteCompleted(String streamName, Boolean success, Object writeContext)
於 System.Configuration.Internal.DelegatingConfigHost.WriteCompleted(String streamName, Boolean success, Object writeContext)
於 System.Configuration.UpdateConfigHost.WriteCompleted(String streamName, Boolean success, Object writeContext)
於 System.Configuration.MgmtConfigurationRecord.SaveAs(String filename, ConfigurationSaveMode saveMode, Boolean forceUpdateAll)
於 System.Configuration.Configuration.SaveAsImpl(String filename, ConfigurationSaveMode saveMode, Boolean forceSaveAll)
於 System.Configuration.Configuration.Save()
於 SetArgument.Check_Click(Object sender, EventArgs e) 於 d:\2005WebSite\SCM\Manager\SetArgument.aspx.cs: 行 42
於 System.Web.UI.WebControls.Button.OnClick(EventArgs e)
於 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
於 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
於 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
於 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
於 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)