tags:

views:

485

answers:

3

Hi All,

I have two .net applications, these applications want to talk to each other, I made a setting in the first project as follows

[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;
            }
        }

}

the second project may set the BeginWorking setting for the first project in order to tell it to work, and waits for the Completed setting to be set and get the result from the Result setting.

Is that possible and how??

I feel it may be not easy to answer but excuse me I'm get unable to think more.

Thanks All

A: 

Settings are persisted to a configuration file that is saved on disk. As far as I know the default place for this is in the user's application directory (%appdata%). Since this file is persisted to disk your other application would need to be able to read and write to this same file.

If both applications are reading and writing to the same file then you should be able to do what you want to do.

Andrew Hare
+2  A: 

User level app settings are isolated in a subdirectory of AppData. One app cannot find the settings of another app. Just use a plain file.

Hans Passant
+1  A: 

I've not used it but .NET Remoting might be more suitable to your needs see MSDN link text

Ady Kemp