2021-07-16

##C#笔记

c#笔记搬运工_210716

…不允许外接设备拷贝的搬运工…

【线程】

ThreadPool.QueueUserWorkItem(ThreadDoFunction); //线程空闲时运行
ThreadPool.QueueWorkItem(new WaitCallback((obj) =>
{
StatusRefresh(CancellationTokenSource.Token);
}));//回调

.net core 微服务

//微服务配置   客户端 > 服务器
<Node Name="Task">
  <Plugin Name="MCDevMacrosServer"/>
</Node>
<Node Name="Link">
  <Plugin Name="MCDeviceServer"/>
</Node>

IBaseConsumer

客户端 MicroServices.Consumer.BL.dll
服务器 MicroServices.BL.dll

服务器IF

[ServiceRoute(“GetCollections”, Description = “获取集合”)]
GetCollections(){…}

当前系统采用秒监测更新,异步实时上报

NetMQHelper.Instance.Publisher.Publish();
//MQData 消息处理
//MetaData 数据处理

加载程序集

Assembly.Load(“xxx”//程序集名 ).GetType(//例 “CET.MCS.Param”);

Protobuf 详解
http://blog.csdn.net/q__y__L/article/details/86740156

Device基类

namespace xxx
{
    [Serializable]
    public class Device : IDevice, ICommReport
    {............}

//public interface IDevice { } 接口
//public interface ICommReport { }  上报接口
}

【Action】

public Action<string> StatusReport { get; set;}
public event Action<int, string> ActionControl;
ActionControl += Function2;  //事件,类似函数指针
ActionControl?.Invoke(intxx, stringxx); //调用

字节数组 > 类型

Marshal.AllocHGlobal()
Marshal.Copy()
Marshal.PtrToStructure()  // 主要
Marshal.FreeHGlobal()

【SQL 查询所有表】

select table_name from 
information_schema.tables where 
table_schema='testdb';

【查询是否存在xxx表】

select count(*) from 
(select table_name from 
information_schema.tables where 
table_schema='testdb') as table_a 
where table_a.table_name='tb_test_1';
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值