コード例 #1
0
    static void Main(string[] args)
    {
        int v = 7;

        RemotingConfiguration.Configure("Client.exe.config", /*ensureSecurity*/ true);  // o booleano é pq a outra versão ficou deprecada
        RemObj obj = new RemObj();

        Console.WriteLine(obj.Hello());
        Console.ReadLine();
    }
コード例 #2
0
ファイル: Client.cs プロジェクト: Marko50/TDIN
    static void Main()
    {
        RemotingConfiguration.Configure("Client.exe.config");
        RemObj obj = new RemObj();

        A   a  = obj.GetA();
        int a1 = a.Data;

        Console.WriteLine("[Client]: a.Data = {0}", a1);
        B   b  = obj.GetB();
        int b1 = b.Data;

        Console.WriteLine("[Client]: b.Data = {0}", b1);
        Console.ReadLine();
    }
コード例 #3
0
ファイル: Client.cs プロジェクト: Marko50/TDIN
    static void Main()
    {
        RemotingConfiguration.Configure("Client.exe.config");
        RemObj    obj     = new RemObj();
        ClSponsor sponsor = new ClSponsor();

        sponsor.RenewalTime = TimeSpan.FromSeconds(5);
        sponsor.Register(obj);

        Console.WriteLine(obj.Hello());
        Console.ReadLine();
        Console.WriteLine(obj.Hello());
        Console.ReadLine();

        sponsor.Unregister(obj);
    }
コード例 #4
0
    static void Main()
    {
        RemotingConfiguration.Configure("Client.exe.config");
        RemObj obj = new RemObj();

        Console.WriteLine("[Client]: call GetA()");
        A   a  = obj.GetA();
        int a1 = a.Data;

        Console.WriteLine("[Client]: a.Data = {0}", a1);
        Console.ReadLine();
        Console.WriteLine("[Client]: call GetB()");
        B   b  = obj.GetB();
        int b1 = b.Data;

        Console.WriteLine("[Client]: b.Data = {0}", b1);
        Console.ReadLine();
        Console.WriteLine("[Client]: construct an A initialized with 33");
        a  = new A(33);
        a1 = a.Data;
        Console.WriteLine("[Client]: a.Data = {0}", a1);
        Console.ReadLine();
        Console.WriteLine("[Client]: call SetA()");
        obj.SetA(a);
        Console.WriteLine("[Client]: call UseA()");
        a1 = obj.UseA();
        Console.WriteLine("[Client]: returned from UseA = {0}", a1);
        Console.ReadLine();
        Console.WriteLine("[Client]: construct a B initialized with 44");
        b  = new B(44);
        b1 = b.Data;
        Console.WriteLine("[Client]: b.Data = {0}", b1);
        Console.ReadLine();
        Console.WriteLine("[Client]: call SetB()");
        obj.SetB(b);
        Console.WriteLine("[Client]: call UseB()");
        b1 = obj.UseB();
        Console.WriteLine("[Client]: returned from UseB = {0}", b1);
        Console.ReadLine();
    }