当前位置: 首页 > 编程日记 > 正文

C#之消息队列的简要说明

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Messaging ;
using System.Threading ;

namespace WinMsmq
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
static ManualResetEvent signal = new ManualResetEvent(false);
static ManualResetEvent pubRecvieSignal=new ManualResetEvent(false);
private System.Messaging.MessageQueue mq=null;
private readonly string qryname=@"";
private MessageQueue msq=null;
private MessageQueue pubMsq=null;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Button button7;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Button sendToPub;
private System.Windows.Forms.Button readFromPub;
private System.Windows.Forms.Button Creaet;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button delPubmsg;
private System.Windows.Forms.Button srPub;
private System.Data.SqlClient.SqlConnection sqlConnection1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
this.qryname=System.Configuration.ConfigurationSettings.AppSettings["pubMsmqQryName"];
if(MessageQueue.Exists(qryname))
{
this.pubMsq=new MessageQueue(qryname,true);
}
else
{
this.pubMsq=System.Messaging.MessageQueue.Create(qryname,true);
}
this.richTextBox1.AppendText("==================/r/n");
this.richTextBox1.AppendText(this.pubMsq .QueueName +":公共队列创建成功!/r/n");

//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button4 = new System.Windows.Forms.Button();
this.button7 = new System.Windows.Forms.Button();
this.Creaet = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.srPub = new System.Windows.Forms.Button();
this.delPubmsg = new System.Windows.Forms.Button();
this.readFromPub = new System.Windows.Forms.Button();
this.sendToPub = new System.Windows.Forms.Button();
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(8, 56);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "SendMsg";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(8, 16);
this.button2.Name = "button2";
this.button2.TabIndex = 1;
this.button2.Text = "CreateMsmq";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(8, 104);
this.button3.Name = "button3";
this.button3.TabIndex = 2;
this.button3.Text = "ReadMsg";
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// richTextBox1
//
this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.richTextBox1.Location = new System.Drawing.Point(0, 152);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(640, 188);
this.richTextBox1.TabIndex = 3;
this.richTextBox1.Text = "richTextBox1";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.button2);
this.groupBox1.Controls.Add(this.button1);
this.groupBox1.Controls.Add(this.button3);
this.groupBox1.Location = new System.Drawing.Point(16, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(144, 136);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "非事务";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.button4);
this.groupBox2.Controls.Add(this.button7);
this.groupBox2.Controls.Add(this.Creaet);
this.groupBox2.Controls.Add(this.button6);
this.groupBox2.Controls.Add(this.button5);
this.groupBox2.Location = new System.Drawing.Point(184, 0);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(240, 136);
this.groupBox2.TabIndex = 5;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "事务性";
//
// button4
//
this.button4.Location = new System.Drawing.Point(168, 80);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(56, 48);
this.button4.TabIndex = 5;
this.button4.Text = "CreateMsmqWithTran";
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// button7
//
this.button7.Location = new System.Drawing.Point(16, 104);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(136, 23);
this.button7.TabIndex = 4;
this.button7.Text = "ClearMsgOfRichTxtBox";
this.button7.Click += new System.EventHandler(this.button7_Click);
//
// Creaet
//
this.Creaet.Location = new System.Drawing.Point(144, 32);
this.Creaet.Name = "Creaet";
this.Creaet.Size = new System.Drawing.Size(80, 40);
this.Creaet.TabIndex = 3;
this.Creaet.Text = "异步读取消息";
this.Creaet.Click += new System.EventHandler(this.Read);
//
// button6
//
this.button6.Location = new System.Drawing.Point(16, 72);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(104, 23);
this.button6.TabIndex = 2;
this.button6.Text = "ReadMsgTran";
this.button6.Click += new System.EventHandler(this.button6_Click);
//
// button5
//
this.button5.Location = new System.Drawing.Point(16, 32);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(104, 24);
this.button5.TabIndex = 1;
this.button5.Text = "SendMsgTran";
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// groupBox3
//
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox3.Controls.Add(this.srPub);
this.groupBox3.Controls.Add(this.delPubmsg);
this.groupBox3.Controls.Add(this.readFromPub);
this.groupBox3.Controls.Add(this.sendToPub);
this.groupBox3.Location = new System.Drawing.Point(432, 0);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(208, 136);
this.groupBox3.TabIndex = 6;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "公共队列";
//
// srPub
//
this.srPub.Location = new System.Drawing.Point(144, 72);
this.srPub.Name = "srPub";
this.srPub.Size = new System.Drawing.Size(56, 48);
this.srPub.TabIndex = 4;
this.srPub.Text = "检索公共队列";
this.srPub.Click += new System.EventHandler(this.srPub_Click);
//
// delPubmsg
//
this.delPubmsg.Location = new System.Drawing.Point(8, 96);
this.delPubmsg.Name = "delPubmsg";
this.delPubmsg.Size = new System.Drawing.Size(112, 24);
this.delPubmsg.TabIndex = 3;
this.delPubmsg.Text = "DeletePubMsmg";
this.delPubmsg.Click += new System.EventHandler(this.delPubmsg_Click);
//
// readFromPub
//
this.readFromPub.Location = new System.Drawing.Point(8, 64);
this.readFromPub.Name = "readFromPub";
this.readFromPub.Size = new System.Drawing.Size(128, 24);
this.readFromPub.TabIndex = 2;
this.readFromPub.Text = "ReadMsgFromPubMsmg";
this.readFromPub.Click += new System.EventHandler(this.readFromPub_Click);
//
// sendToPub
//
this.sendToPub.Location = new System.Drawing.Point(8, 32);
this.sendToPub.Name = "sendToPub";
this.sendToPub.Size = new System.Drawing.Size(144, 24);
this.sendToPub.TabIndex = 1;
this.sendToPub.Text = "SendMsgToPubMsmq";
this.sendToPub.Click += new System.EventHandler(this.sendToPub_Click);
//
// sqlConnection1
//
this.sqlConnection1.ConnectionString = "workstation id=DHZ;packet size=4096;integrated security=SSPI;data source=/"DHZ//DHZ" +
"/";persist security info=False;initial catalog=Northwind";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(648, 349);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.richTextBox1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{

if(MessageQueue.Exists(@"./private$/dhzOrderMgmt"))
{
this.mq=new MessageQueue(@"./private$/dhzOrderMgmt");
}
else
{
this.mq=MessageQueue.Create(@"./private$/dhzOrderMgmt",false);
}
this.richTextBox1.AppendText("==================/r/n");
this.richTextBox1.AppendText(mq.QueueName +":创建成功!/r/n");


}
private void button1_Click(object sender, System.EventArgs e)
{
Od od=new Od("代汉章","南昌",DateTime.Now.ToLongTimeString ());
if(this.mq.Transactional)
{
this.mq.Send(od,new System.Messaging.MessageQueueTransaction ());
}
else
{
this.mq.Send(od);
}
this.richTextBox1.AppendText("发送成功!/r/n");
}
private void button2_Click(object sender, System.EventArgs e)
{

if(MessageQueue.Exists(@"./private$/dhzOrderMgmt"))
{
this.mq=new MessageQueue(@"./private$/dhzOrderMgmt");
}
else
{
this.mq=MessageQueue.Create(@"./private$/dhzOrderMgmt",false);
}
this.richTextBox1.AppendText("==================/r/n");
this.richTextBox1.AppendText(mq.QueueName +":创建成功!/r/n");


}
private void button3_Click(object sender, System.EventArgs e)
{
if(this.mq!=null)
{
System.Messaging.MessageEnumerator msg=this.mq.GetMessageEnumerator ();
while(msg.MoveNext ())
{
System.Messaging .Message oc=msg.Current ;
Od od=oc.Body as Od ;
this.richTextBox1.AppendText(od.Name +":"+od.City +":"+od.Time +";/r/n");

}

}
}
private void button4_Click(object sender, System.EventArgs e)
{
if(MessageQueue.Exists(@"./private$/dhzTrans"))
{
this.msq =new MessageQueue(@"./private$/dhzTrans");
}
else
{
this.msq=MessageQueue.Create(@"./private$/dhzTrans",true);
}
this.richTextBox1.AppendText("==================/r/n");
this.richTextBox1.AppendText(msq.QueueName +":创建成功!/r/n");

}
private void button5_Click(object sender, System.EventArgs e)
{

this.msq=new MessageQueue(@"./private$/dhzTrans");
if(this.msq.Transactional)
{
Od od=new Od("万卿","景德镇",DateTime.Now.ToString("u"));
MessageQueueTransaction myTransaction = new
MessageQueueTransaction();
myTransaction.Begin();
msq.Send(od,myTransaction);
myTransaction.Commit();
this.richTextBox1.AppendText("OK!发送成功:"+od.Time+"/r/n" );
}

}
private void button6_Click(object sender, System.EventArgs e)
{
this.msq=new MessageQueue(@"./private$/dhzTrans");
if(this.msq .Transactional )
{
MessageQueueTransaction myTransaction = new MessageQueueTransaction();
this.msq.Formatter=new System.Messaging.XmlMessageFormatter (new Type[]{Type.GetType("WinMsmq.Od" )});
myTransaction.Begin();
System.Messaging.Message ms=msq.Receive(myTransaction);
Od od=ms.Body as Od ;
this.richTextBox1.AppendText(od.Name +":"+od.City +":"+od.Time +";/r/n");
myTransaction.Commit();
this.richTextBox1.AppendText("OK!发送成功/r/n");
}
}
private void Read(object sender, System.EventArgs e)
{
this.msq=new MessageQueue(@"./private$/dhzTrans");
if(this.msq.Transactional)
{
MessageQueueTransaction myTransaction = new MessageQueueTransaction();
msq.ReceiveCompleted += new ReceiveCompletedEventHandler(MyReceiveCompleted);
this.msq.Formatter=new System.Messaging.XmlMessageFormatter (new Type[]{Type.GetType("WinMsmq.Od" )});
myTransaction.Begin();
msq.BeginReceive();
Form1.signal.WaitOne ();
myTransaction.Commit ();
}
}
private void MyReceiveCompleted(Object source,ReceiveCompletedEventArgs asyncResult)
{
try
{
MessageQueue mq = (MessageQueue)source;
System.Messaging .Message m = mq.EndReceive(asyncResult.AsyncResult);
Form1.signal.Set ();
Od od=m.Body as Od ;
this.richTextBox1.AppendText ("Read:"+od.Name +":"+od.City +":"+od.Time +"/r/n"+"插入数据库完成/r/n");
mq.BeginReceive();
}
catch(MessageQueueException c)
{
this.richTextBox1.AppendText("Error:"+c.Message +"/r/n");
this.button5.Enabled=false;
}
// Handle other exceptions.


}
private void button7_Click(object sender, System.EventArgs e)
{
this.richTextBox1.Clear ();
}
private void delPubmsg_Click(object sender, System.EventArgs e)
{
//删除创建的公共队列
System.Messaging.MessageQueue.Delete (qryname);
}
private void srPub_Click(object sender, System.EventArgs e)
{
MessageQueue[] mq=System.Messaging.MessageQueue.GetPublicQueuesByMachine ("dhz");
for(int i=0;i<mq.Length ;i++)
{
this.richTextBox1.AppendText(mq[i].QueueName +":/r/n");
}

}
private void sendToPub_Click(object sender, System.EventArgs e)
{
if(this.pubMsq==null)
this.pubMsq=new MessageQueue(this.qryname );
if(this.pubMsq.Transactional )
{
Od od=new Od("万卿","景德镇",DateTime.Now.ToString("u"));
MessageQueueTransaction myTransaction = new
MessageQueueTransaction();
myTransaction.Begin();
pubMsq.Send(od,myTransaction);
myTransaction.Commit();
}
}
private void readFromPub_Click(object sender, System.EventArgs e)
{
this.pubMsq=new MessageQueue(this.qryname );
if(this.pubMsq.Transactional)
{
MessageQueueTransaction myTransaction = new MessageQueueTransaction();
pubMsq.ReceiveCompleted += new ReceiveCompletedEventHandler(MyReceiveCompleted);
this.pubMsq.Formatter=new System.Messaging.XmlMessageFormatter (new Type[]{Type.GetType("WinMsmq.Od" )});
myTransaction.Begin();
pubMsq.BeginReceive();
Form1.signal.WaitOne ();
myTransaction.Commit ();
}

}



}
}
/================
public class Od
{
public Od()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public Od(string na,string cty,string timestr)
{
this.name=na;
this.city=cty;
this.time=timestr;

}
private string time="";
private string name;
private string city;
public string Name
{
get{return this.name ;}
set{this.name=value;}
}
public string City
{
get{return this.city ;}
set{this.city=value;}
}
public string Time
{
get{return this.time ;}
set{this.time=value;}
}
}
=======================App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!--ComputerName-->
<!--dhz:是域控制器所在的计算机名:-->
<add key="QcName" value="dhz/FormatName:Public=620B1BFB-18E9-4d80-B869-FF6FB2DFDD08"></add>
</appSettings>
</configuration>

相关文章:

Arm收购进展、元宇宙、GPU涨价……听听黄仁勋怎么说

今年的台北国际电脑展 (Computex) 于 6 月 1-5 日在线上召开&#xff0c;期间 NVIDIA CEO 黄仁勋接受了媒体的线上群访&#xff0c;本文对采访内容进行了翻译与整理。对厨房情有独钟的黄教主&#xff0c;走出了厨房&#xff0c;选择了 NVIDIA 新办公大楼 Voyager&#xff08;旅…

要立刷金组flag了T_T

刷了那么多银组&#xff0c;发现自己好多不会啊... 果然太弱 在这感谢hzwer神犇的blog。。 大部分题解都从黄学长这里来orz。 orz。。。。 果然我太水

Centos7更改root密码

方法一#Step1&#xff1a;重启linux命令&#xff1a;rebootinit 6shutdown -r now#Step2&#xff1a;进grub改启动参数启动界面按“e”ro 改为rw init/sysroot/bin/shCtrlX保存做的更改&#xff0c;这时已经进入操作界面了#Step3&#xff1a;CtrlD然后init 6重启电脑&#xff0…

C#实现Des加密和解密

using System; using System.IO; using System.Security.Cryptography; namespace Vavic { /// <summary> /// Security 的摘要说明。 /// </summary> public class Security { const string KEY_64 "VavicApp"; const string IV_64 "V…

10 行代码玩转 NumPy!

作者 | 天元浪子来源 | Python作业辅导员NumPy也可以画图吗&#xff1f;当然&#xff01;NumPy不仅可以画&#xff0c;还可以画得更好、画得更快&#xff01;比如下面这幅画&#xff0c;只需要10行代码就可以画出来。若能整明白这10行代码&#xff0c;就意味着叩开了NumPy的大门…

秘钥加密码的登录模式

应用场景&#xff1a;有时候我们要给远在北京或者国外的开发人员服务器的权限&#xff0c;为了保证服务器的安全性我们不想让他们知道服务器的root登陆密码&#xff0c;所以我们可以给他们用秘钥加密码的登陆模式。原理&#xff1a;公钥加密 私钥解密。公钥和私钥是成对生成的&…

【C#小知识】C#中一些易混淆概念总结(七)---------解析抽象类,抽象方法

目录&#xff1a; 【C#小知识】C#中一些易混淆概念总结--------数据类型存储位置&#xff0c;方法调用&#xff0c;out和ref参数的使用 【C#小知识】C#中一些易混淆概念总结&#xff08;二&#xff09;--------构造函数&#xff0c;this关键字&#xff0c;部分类&#xff0c;枚…

关于C语言中的malloc和free函数的用法

一、malloc()和free()的基本概念以及基本用法&#xff1a; 1、函数原型及说明&#xff1a; void *malloc(long NumBytes)&#xff1a;该函数分配了NumBytes个字节&#xff0c;并返回了指向这块内存的指针。如果分配失败&#xff0c;则返回一个空指针&#xff08;NULL&#xff0…

爱购,你的最爱

这是个基于淘宝的购物软件,天天有特价转载于:https://www.cnblogs.com/ios1/p/3969797.html

「深度学习知识体系总结(2021版)」开放下载了!

随着世界技术的迭代与发展&#xff0c;人工智能和机器学习正在超自动化领域&#xff0c;扮演着越来越重要的角色。2020年的冠状病毒疫情突发&#xff0c;整个世界都在防疫的道路上披荆斩棘。人工智能发挥了重大作用&#xff0c;智能测温、智能消毒、智能建设都能看到AI的影子。…

自定义通知与系统通知的学习(详解)

因为有需求要做非系统通知&#xff0c;所以小马找个时间干脆一起学习了系统默认的通知与自定义通知的实现&#xff0c;吼吼&#xff0c;虽然简单&#xff0c;但开心呀&#xff0c;不多讲&#xff0c;老规矩&#xff0c;先看效果再来看代码&#xff1a; 一&#xff1a;应用刚启动…

Quick Cocos2dx 初步战斗

呵呵&#xff0c;图片先来一发&#xff1a; 最近懒&#xff0c;很懒&#xff0c;连我自己都觉得有点可耻了。 但是实在没有什么东西啊&#xff0c;温水煮青蛙的什么的。 吐槽完成&#xff0c;以上。 目前完成了简单的战斗部分&#xff0c;AI还需要抽出来。 然后突然之间想到手游…

C#简介- 类和对象

类&#xff08;class&#xff09;是C#类型中最基础的类型。类是一个数据结构&#xff0c;将状态&#xff08;字段&#xff09;和行为&#xff08;方法和其他函数成员&#xff09;组合在一个单元中。类提供了用于动态创建类实例的定义&#xff0c;也就是对象&#xff08;object&…

普诺飞思获创新工场新一轮投资,加速神经拟态视觉传感技术商业化

2021年7月6日&#xff0c;中国上海——世界领先的神经拟态视觉解决方案企业普诺飞思&#xff08;Prophesee&#xff09;今日宣布 C轮融资&#xff0c;由创新工场领投、小米及上海韦豪创芯跟投&#xff0c;数家老股东加码。其中&#xff0c;小米是全球三大移动设备供应商之一&am…

YYHS-魏传之长坂逆袭(梦回三国系列T1)

题目描述 众所周知&#xff0c;刘备在长坂坡上与他的一众将领各种开挂&#xff0c;硬生生从曹操手中逃了出去&#xff0c;随后与孙权一起火烧赤壁、占有荆益、成就霸业。而曹操则在赤壁一败后再起不能&#xff0c;终生无力南下。建安二十五年(220年)&#xff0c;曹操已到风烛残…

Linux中/proc目录下文件详解

Linux中/proc目录下文件详解&#xff08;一&#xff09;声明&#xff1a;可以自由转载本文&#xff0c;但请务必保留本文的完整性。作者&#xff1a;张子坚email:zhangzijian163.com说明&#xff1a;本文所涉及示例均在fedora core3下得到。 ---------------------------------…

Swift常量和变量

常量和变量由一个特定名称来表示&#xff0c;如maxNumber 或者 message。常量所指向的是一个特定类型的值&#xff0c; 如数字10或者字符”hello”。变量的值可以根据需要不断修改&#xff0c;而常量的值是不能够被二次修改的。 常量和变量的声明 常量和变量在使用前都需要声明…

Openpose+Tensorflow 这样实现人体姿态估计 | 代码干货

作者 | 李秋键出品 | AI科技大本营&#xff08;ID:rgznai100&#xff09;人体姿态估计指从单个 RGB 图像中精确地估计出人体的位置以及检测骨骼关键点的位置。人体姿态估计是计算机视觉领域的研究热点&#xff0c;是诸多计算机视觉任务的基础&#xff0c;如动作分类、异常行为检…

主动防病毒内容篇

为何需要主动防病毒 近年来&#xff0c;对于防病毒软件效用的争论有愈演愈烈之势。我们知道&#xff0c;目前几乎所有的主流防病毒产品都是以分析病毒特征码为基础&#xff0c;通过升级安装在用户端的病毒特征码数据库实现对病毒的辨识。只有发现和确认了病毒之后&#xff0c;才…

icinga服务器系统监控软件的安装

系统环境rhel和Centos都可以安装这里我们所使用的安装包为中文版的icinga-cn-1.9.3.tar.bz2&#xff08;1&#xff09;安装icinga软件所支持的组件包&#xff08;我们这里采用yum源的方式&#xff09;组件&#xff1a;libdbi-dbd-mysql-0.8.3-5.1.el6.x86_64.rpmgd-devel-2.0.3…

size_t与ssize_t

size_t与ssize_t 为了增强程序的可移植性&#xff0c;便有了size_t&#xff0c;它是为了方便系统之间的移植而定义的&#xff0c;不同的系统上&#xff0c;定义size_t可能不一样。 l 在32位系统上定义为unsigned int &#xff0c;也就是说在32位系统上是32位无符号整形…

自动驾驶中实时车道检测和警报

作者 | 小白 来源 | 小白学视觉未来十年&#xff0c;自动驾驶将彻底改变人们的出行方式。目前&#xff0c;自动驾驶应用程序目前正在测试各种案例&#xff0c;包括客车、机器人出租车自、动商业运输卡车、智能叉车以及用于农业的自动拖拉机。自动驾驶需要计算机视觉感知模块来…

OSS.Core基于Dapper封装(表达式解析+Emit)仓储层的构思及实现

最近趁着不忙&#xff0c;在构思一个搭建一个开源的完整项目&#xff0c;至于原因以及整个项目框架后边文章我再说明。既然要起一个完整的项目&#xff0c;那么数据仓储访问就必不可少&#xff0c;这篇文章我主要介绍这个新项目&#xff08;OSS.Core&#xff09;中我对仓储层的…

GNU Make chapter 2 —— Makefile 介绍

Makefile是由一系列的rule规则组成&#xff0c;这些rule都遵循以下形式: target ... : prerequisites ...command...... target&#xff08;目标&#xff09; 一般来说是需要生成的程序&#xff08;模块&#xff09;的名字&#xff0c;也可以是要执行的动作的名字&#xff0c;这…

C#编写的生成缩略图程序

if(fileupload.PostedFile!null) { //addto为要添加的属性&#xff0c;aboutfile为文件说明 string nam fileupload.PostedFile.FileName ; //取得文件名(抱括路径)里最后一个"."的索引 int i nam.LastIndexOf("."); /…

深度盘点Python11个主流框架:Pandas、Django、Matplotlib、Numpy、PyTorch......

六月份TIOBE编程语言排行榜&#xff0c;位居第二名的Python与第一名C语言之间的差距正在逐渐缩小。Python如此受欢迎一方面得益于它崇尚简洁的编程哲学&#xff0c;另一方面是因为强大的第三方库生态。要说杀手级的库&#xff0c;很难排出个先后顺序&#xff0c;因为python的明…

多表查询 外连接

关于外连接查询&#xff1a;链接查询的时候经常直接使用连接语句&#xff0c;可是如果只有主键没有写其他属性的时候&#xff0c;直接用连接查询得到的记录数是不完整的。 所以应该使用外连接查询&#xff1a;left join on 或者right join on. 例如在工单管理部分绑定到gridvie…

C#生成Excel文件的方法

一个示例&#xff1a; class AppTest { private Excel.ApplicationClass _x; public static void Main0() { AppTest a new AppTest(); a._x new Excel.ApplicationClass(); a._x.UserControl false; for (int i 0 ;i < 4; i) { a.SaveToXls("D://test//" i…

太酷了,Python 制作足球可视化图表 | 代码干货

作者 | 小F来源 | 法纳斯特大家好&#xff0c;我是小F。最近不少小伙伴都会熬夜看欧洲杯。今年的欧洲杯相比起往年的欧洲杯来说&#xff0c;可谓是冷门频出&#xff0c;出乎意料。真的不知道&#xff0c;第一会花落谁家&#xff5e;本期小F就和大家分享一下&#xff0c;用Pytho…

便捷,轻巧的Groovy数据库操作

本文主要介绍Groovy对数据的CRUD操作&#xff0c;熟悉groovy.sql包&#xff0c;测试使用的数据库是H2。1.数据库连接配置//数据库连接配置 def db [url:jdbc:h2:mem:groovy,user:root,password:root,driver:org.h2.Driver ];2.创建数据库连接&#xff0c;这里使用到Groovy的Sq…