随笔分类 - Winform
摘要:1,需求 对象属性发生变化 更新UI2, 方法: 在对象中定义事件,在属性中调用事件 // 属性 public string EmrTitle { get { return _category.EmrTitle.Text; } set { if (_category.EmrTitle.Text != value) { // 出发事件 if (OnEmrTitleChanged ...
阅读全文
摘要:public class MessageUtil { /// <summary> /// 显示一般的提示信息 /// </summary> /// <param name="message">提示信息</param> public static DialogResult ShowTips(string message) { return MessageBox.Show(message, "提示信息",MessageBoxButtons.OK, MessageBoxIcon.Info...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO.Pipes;using System.Security.Principal;namespace TopInfo.Metevation.Common{ public class PipeMessageUtil { private const string PipeName = "TopInfoPipe"; public static bool NeedSendMessage = fa
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runtime.InteropServices;using System.Diagnostics;namespace TopInfo.Metevation.Common{ //WM_COPYDATA消息所要求的数据结构 public struct CopyDataStruct { public IntPtr dwData; public int cbData; [MarshalAs(UnmanagedTyp
阅读全文
摘要:调用:FtpOption ftp = new FtpOption("10.128.3.90", "21", "uid", "pwd");下载文件:bool success = ftp.DownLoadNotReName("ST/mylyb/grapes/03/11041112.003", "E:/");bool success = ftp.DownLoadReName("ST/myl-yb/grapes/03/11041112.003", "E:
阅读全文
摘要:1.vs ->Windows服务2.创建完成后在项目下默认会创建 Program.cs 和 Service1.cs双击Service1.cs到设计,在设计区右击,选择添加安装程序产生2个组建点击ServiceInstaller1 设置相关属性3.在Service1.cs 事件:protected override void OnStart(string[] args) { }服务开启时protected override void OnStop() { }服务停止时要想在程序安装时自动启动服务:在ProjectInstaller.cs里: public ProjectInstaller
阅读全文