C#笔记

【C#】C#入门笔记 文章目录1.一个 C# 程序主要包括以下部分:2.数据类型详解2.1 值类型2.2 引用类型2.3 指针类型(Pointer types)3. C#的类型转换4. 常量4.1 整数常量 本章比较杂乱,是本人在学习C#中的一些笔记,并不全面,只是一些随笔。 1.一个 C# 程序主要包括以下部分: 命名空间声明(Namespace declaration) 一个 class Class 方法 Clas... 阅读详情

一、给窗体加载监听事件方法:

 

    1、选中窗体更改其属性 keyPreview 为True

    2、到窗体 KeyDown 事件写入代码 如:

 

         if (e.KeyCode == Keys.Escape )

            {

                this.Close();

            }

注意:Keys.Escape 中的 Escape 可是键盘上的任意一个键

 

 

 

二、鼠标单击 button 弹出下拉菜单方法:

 

   1、增加 ContextMenuStrip 控件 并增添其下拉要显示的菜单 

   2、给 button 的MouseClike 事件写入代码 如:

   

        if (e.Button == System.Windows.Forms.MouseButtons.Left)

            {

                cms_out2.Show(MousePosition);

            }

 

 

 

三、ADO.NET 处理多条件的查询SQL语句的处理( where 1=1)

 

string sSql = "select ID, FlightNO, LeaveCity, Destination, LeaveTime"

                +" from TicketInfo where 1=1";

 

            if (txtSearchFrom.Text.Trim() != "")

            {

                sSql += string.Format(" And LeaveCity like '%{0}%'", txtSearchFrom.Text.Trim());

            }

 

            if (txtSearchTo.Text.Trim() != "")

            {

                sSql += string.Format(" And Destination like '%{0}%'", txtSearchTo.Text.Trim());

            }

 



基于MATLAB的拉盖尔-高斯光束叠加相位模拟 首先,我们需要设置模拟所需的参数,如光腰半径、传播距离、光束的角动量等。其中,(U)表示光束的电场复振幅,(r)和(\phi)分别是极坐标系下的径向和角向坐标,(z)是传播距离,(A)是归一化系数,(w_p)是光束的光腰半径,(L_p^q)是拉盖尔多项式,(k)是波数,(l)是光束的角动量。通过修改模拟参数,如光腰半径、传播距离、角动量等,您可以进一步探索和理解拉盖尔-高斯光束的叠加相位效应。拉盖尔-高斯光束是一种特殊的光束模式,具有广泛的应用领域,包括光学信息处理、激光加工和量子光学等。 阅读详情

相关推荐

11种图像清晰度评价函数附MATLAB代码

博主的第一篇博客! 本科毕业论文是“基于图像处理的自动对焦技术研究”,对焦过程中的一个重要阶段是图像清晰度评价,博主自己用MATLAB实现了4类清晰度评价函数:基于图像梯度的清晰度评价函数、频域评价函数、信息熵评价函数、统计学评价函数,总计11种。博主之前没有用过MATLAB,完全是本科论文需要,没办法对着别人的代...

kungfu_rabbit的博客 5万+

C# 键盘KeyCode与keyValue

在C#中,经常用到键盘事件,用到键盘事件时,就需要知道键的KeyCode(键),或者是keyValue(键值)。 如:Enter的键盘事件,KeyCode = Enter,keyValue = 13         private void Key_down(object sender, KeyEventArgs e)         {             if (e.KeyValu

smooth_tailor的博客 2万+

VoIP概述

VoIP统一通信与VoIPVoIP与传统电话比较VoIP各项产品设备的类型及应用 统一通信与VoIP 统一通信指的是把计算机与传统通信技术统一成一体的新通信模式,融合计算机网络与传统通信网络在一个网络平台上,实现电话、传真、数据传输、音视频会议、呼叫中心、即时通信等众多应用服务 VoIP又称IP电话或IP网络电话,是Voice Over IP的缩写,这种技术通过对语音信号进行编码数字化,压缩处理成压缩帧,然后转换成为IP数据包在TCP/IP网络上进行传输,从而达到了在IP网络上进行语音通信目的 VoIP与传

kaminao的博客 4358

e.keycode 代码含义

本文摘自:http://www.cnblogs.com/king-sheng/archive/2012/01/06/2314041.html 感谢原作者 function submitLoginForm(e) {  e = window.event || e;  if(e.keyCode == 13) {   login();  } }  

楷楷的博客 1万+

单细胞多组学数据整合分析实战:从原始数据到跨平台合并

本文详细介绍了单细胞多组学数据整合分析的实战流程,从原始数据处理到跨平台合并分析。通过Seurat和Harmony等工具的应用,帮助研究者有效解决批次效应问题,保留真实的生物学信号。文章包含代码示例和常见问题解决方案,特别适合需要进行单细胞合并分析的研究人员参考。

weixin_30752699的博客 90

从零到一:Halcon手眼标定的实战避坑指南

本文详细解析了Halcon手眼标定的完整流程,重点介绍了Eye-in-Hand和Eye-to-Hand两种模式的实操技巧与常见陷阱。通过九点法、N点法等实战案例,提供硬件配置检查、数据采集策略及误差修正方案,帮助开发者提升机械臂与视觉系统的协同精度,适用于工业自动化领域的精准定位与抓取任务。

neovim7hacker的博客 234

c#笔记

一、给窗体加载监听事件方法:    1、选中窗体更改其属性 keyPreview 为True    2、到窗体 KeyDown 事件写入代码如:         if (e.KeyCode == Keys.Escape )            {                this.Close();            }注意:Keys.Escape 中的 Escape 可用时键盘上的任意一个键二、鼠标单击 button 弹出下拉菜单方法:   1、增加 ContextMenuStrip 控件并增添

junjun199017的专栏 390

Isaac Sim 6 利用Replicator实现高效语义分割与实例分割(实践指南5.10)

本文详细介绍了如何利用Isaac Sim 6的Replicator工具高效生成语义分割和实例分割数据集。通过虚拟环境自动标注,效率提升20倍以上,特别适用于农业机器人等计算机视觉项目。文章包含环境配置、场景构建、批量标注技巧及实例分割处理等实战指南,帮助开发者快速掌握合成数据生成技术。

weixin_42526415的博客 266

7.基础查询(select from)

进阶一:基础查询 /* 语法: select 查询列表 from 表名; 特点: 1.查询列表可以是:表中的字段,常量值,表达式,函数 2.查询结果是一个虚拟的表格 */ myemployees表::对其进行一系列的基础查询 USE myemployees; #表示当前操作表 #1.查询单个字段 SELECT last_name FROM employees; #2.查询多个字段 SELECT last_name, salary, email FROM employees; #3.查询表中所有

SLSLSLSLSLSLS的博客 7618

【PCIe 总线及设备入门学习专栏 6.1 -- PCIe MCTP】

MCTP 是由 DMTF(Distributed Management Task Force)定义的协议,用于提供设备和主机间基于不同传输层(如 PCIe、I²C、USB 等)的管理消息通信能力。在 PCIe 环境下,MCTP 消息作为的一种特殊形式传输,并被赋予唯一的 VDM Code 值0000b,以区别于其他 VDM。MCTP 在 PCIe 环境中作为一种基于 Type 1 VDM 的管理通信协议,提供了设备与主机之间的灵活数据传输能力。

CodingCos的博客 2127

Ollama DNS 重新绑定攻击 (CVE-2024-28224)

一旦 DNS 重新绑定攻击成功,攻击者就可以对这些 API 进行排序,以读取 Ollama 运行的进程可访问的任意文件数据,并将这些数据泄露到攻击者控制的系统中。完成对“创建模型” API 请求的调用后,Ollama 将收集组成新创建的用户模型的许多工件,包括大型语言模型数据、许可证数据等,以及我们要提取的文件,所有这些都可以通过其 SHA256 内容进行寻址。这是我们要窃取的文件,在我们的示例中,是可通过运行 Ollama 的主机上的路径名访问的现有文本文件。值得注意的是,该模型配置为通过参数中的。

技术超强的网络安全平台 1648

深入分析C#键盘勾子(Hook)拦截器,屏蔽键盘活动的详解

这个列表的指针指向指定的,应用程 序定义的,被Hook子程调用的回调函数,也就是该钩子的各个处理子程。最近安装的钩子放在链的开始, 而最早安装的钩子放在最后,也就是后加入的先获得控制权。也就是说每个进程所拥有的相同的DLL的全局数据,它们的名称相同,但其值却并不一定是相同的,而且是互不干涉的。在钩子子程中调用得到控制权的钩子函数在完成对消息的处理后,如果想要该消息继续传递,那么它必须调用另外一个 SDK中的API函数CallNextHookEx来传递它,以执行钩子链表所指的下一个钩子子程。

weixin_42099527的博客 3826

推荐一个直接用于项目开发的PID库!很好用,很稳定

关注、星标公众号,不错过精彩内容大家好,我是小麦。最近有朋友问到有没有现成的C语言PID库。当然有了!现在我就准备给大家安利一下了。一般同学会去某度上搜,看到各种各样版本的PID示例,或者...

一名热爱技术的工程师的博客。分享技术干货,记录美好生活。永远相信美好的事情即将发生。 9023

C# 学习笔记

MicrosoftVisualStudio(简称VS)是美国微软公司的开发工具包系列产品。VS是一个基本完整的开发工具集,是编写C#程序或者说.NET程序最常用的开发工具。因其功能强大、简单易用、速度快、智能度高,被网友戏称宇宙第一IDE。

qq_52144597的博客 2046

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

C#初学者的笔记

 C#初学者的笔记

学习笔记 557

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

【C#笔记】个人自用笔记

类定义:含有虚方法的类可以是具体的类(即非抽象类),也可以是抽象类。含有抽象方法的类必须被声明为抽象类。调用方式:虚方法可以直接通过基类对象进行调用(如果基类对象引用的是非重写该方法的子类实例,则调用的是基类中的实现;如果引用的是重写了该方法的子类实例,则调用的是子类中的实现),也可以通过子类对象进行调用(调用的是子类中的实现,如果子类没有重写该方法,则调用基类中的实现)。

weixin_45478456的博客 1901

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

c#学习笔记

c#学习笔记

Yamoonn的博客 1214

C#学习笔记(上)

经本人搜集网上资料后整合而成的C#学习笔记,知识点很全面,前面某些很基础的内容绝大部分人都已经在学C/C++的时候学过了,所以基本一笔带过,其它地方都尽量写的很详细。

m0_75104457的博客 2315

XLUA学习笔记之C#和Lua之间的相互调用

感觉学习的笔记还是放在网上查询的时候比较方便,文章初看会感觉很难理清,需要耐心去看,对不起自己对不起翻到我文章的同学,不废话直接上代码。 1.C#调用Lua (耐心!耐心!耐心!) using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using XLua; //这...

xmx5166的博客 7434

【C#笔记自用1】

ContextMenu] 和 [ContextMenuItem]:在Inspector面板的ContextMenu中添加自定义选项,允许开发者通过右键菜单快速执行某些操作或调用方法。[Header]:在Inspector面板中为字段组添加标题,有助于组织和管理大量字段。[Space]:在Inspector面板中的字段之间添加额外的间距,提高可读性。

weixin_45478456的博客 2038

C#学习笔记

C#学习笔记 这是我通过视频学习C#是使用OneNote做的一些笔记,里面有老师讲的重要内容,也有我个人的理解,发布出来希望能和大家一起进步,如有错误,希望能够帮忙指出并指正,谢谢! C#学习笔记1 关于C#里面的输入以及输出: ...

o_thing的博客 209

C#界面笔记

qq_37441795的博客 303

C#使用笔记

C#使用笔记 一、List.AddRange 将指定集合的元素添加到 List 的末尾

dampce32的专栏 143

C#入门个人学习笔记

本人按照哔哩哔哩up主唐老狮进行学习,所使用的ide为Visual Studio 2022。

Sentra233的博客 1243

C#本质论系列笔记

一、系列开篇   系列开篇免不了一大堆废话,先说一下开篇的目的吧。决定走.NET这条路也快一年了,对于.NET的学习也是断断续续的,很多东西看似懂了,却没能深入了解,换句话就是太肤浅了。所以借了一本《C#本质论》,旨在巩固自己对C#这们.NET主打的编程语言的理解。其中很大的一部分都是《C#本质论》里面的东西,所以只能写在文章类别里面,作为一个系列笔记。   与此同时,也借了另外两本本质论《A...

weixin_30664539的博客 167
上一篇: c#笔记
下一篇: C#笔记
junjun199017
博客等级 码龄16年 12粉丝 13原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值