Пример #1
0
 /// <summary>
 /// Inicializa el hosr remoting por marshalling de un objeto (singleton)
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event argument.</param>
 private void InicializarPorMarsall_Click(object sender, EventArgs e)
 {
     try
     {
         HttpServerChannel channel = new HttpServerChannel(8989);
         ChannelServices.RegisterChannel(channel, false);
         _myObjetoRemoto = new MyObjetoRemoto();
         RemotingServices.Marshal(_myObjetoRemoto, "MyObjetoRemoto.rem");
         MessageBox.Show("Objeto Inicializado con exito !", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
         gbxMarshalling.Enabled = true;
         btnInicializeHost.Enabled = false;
     }
     catch (Exception er)
     {
         MessageBox.Show(string.Format("Error:\n{0}", er.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FormMain"/> class.
 /// </summary>
 public FormMain()
 {
     InitializeComponent();
     RemotingConfiguration.Configure("ConfigClienteRemoting.xml", false);
     _myObjetoRemoto = new MyObjetoRemoto();
 }