![](/img/trans.png)
[英]Storage for Properties.Settings for Application Scope in a .Net Library
[英]Change Properties.settings for a .net deployed application
大家好,
我有兩個.net應用程序,這些應用程序想互相通信,我在第一個項目中進行了如下設置
[CompilerGeneratedAttribute()]
[GeneratedCodeAttribute("SettingsSingleFileGenerator", "9.0.0.0")]
public sealed partial class Settings :ApplicationSettingsBase
{
[UserScopedSettingAttribute()]
[DebuggerNonUserCodeAttribute()]
[DefaultSettingValueAttribute("False")]
public bool BeginWorking {
get {
return ((bool)(this["BeginWorking"]));
}
set {
this["BeginWorking"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool Result {
get {
return ((bool)(this["Result"]));
}
set {
this["Result"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool Completed{
get {
return ((bool)(this["Completed"]));
}
set {
this["Completed"] = value;
}
}
}
第二個項目可以為第一個項目設置BeginWorking設置,以使其工作,並等待設置完成的設置並從結果設置中獲取結果。
那有可能嗎?
我覺得這可能不容易回答,但是對不起,我無法想更多。
謝謝大家
用戶級別的應用程序設置位於AppData的子目錄中。 一個應用程序找不到另一應用程序的設置。 只需使用一個普通文件。
我沒有使用過,但是.NET Remoting可能更適合您的需求,請參閱MSDN 鏈接文本。
設置將持久保存到保存在磁盤上的配置文件中。 據我所知,默認位置在用戶的應用程序目錄( %appdata%
)中。 由於此文件保留在磁盤上,因此其他應用程序將需要能夠讀取和寫入同一文件。
如果兩個應用程序都在讀取和寫入同一個文件,那么您應該能夠做您想做的事情。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.