formmain.cs

来自「这是一个Multi-agent典型的C++的代码」· CS 代码 · 共 36 行

CS
36
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CommunicationClasses;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

namespace WindowsApplicationTimeAgent
{
    public partial class FormMain : Form
    {
        private ClassDateTime _dateTime;        
        public FormMain()
        {
            InitializeComponent();            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            _dateTime = (ClassDateTime)Activator.GetObject(
                        typeof(ClassDateTime),
                            "tcp://localhost:9090/RemoteObject.rem");
            timer1.Enabled = true;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            labelCurDateTimeValue.Text = Convert.ToString(_dateTime.getDateTime().ToString());
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?