VB程序员眼中的C# 10(end)

ThinkPHP 8.1 + think-swoole 4.1 实战:5分钟搞定WebSocket聊天室(附完整代码) 本文详细介绍了如何使用ThinkPHP 8.1和think-swoole 4.1快速构建高并发WebSocket聊天室。通过5分钟实战教程,开发者可以轻松实现用户列表、消息广播等核心功能,支持2000+并发连接,适用于客服系统、在线协作等实时通信场景。 阅读详情
C# 中的While与 VB 中的While语句完全相同。当条件为真时,循环就执行。在一个While 循环内部可以使用 Break 语句跳出循环体或者使用Continue 语句继续循环操作。请看下面While语句的应用代码:

   while (n < 10)

   {

   console.writeline(n);

   n++;

   }

   Do

   C# 中的Do循环与 VB 中的Do循环完全相同,它们都在循环的结尾才对条件进行判断。比如:

   do

   {

   console.writeline(n);

   n++;

   }

   while (n < 10);

 

C# 中的For循环与 VB 中的For循环非常相似,只不过循环变量可以在For循环中进行例示。

   请看下面的代码:

   {

   for (int n=0;n< 10;n++)

   console.writeline(n);

   }

   它进行了以下操作:

  • 例示变量n,并给其赋值为 0
  • 只要 n 小于10就继续循环
  • 每个循环给 n 增加1

   ForEach

   C# 中的ForEach 与 VB 中的For Each 语句非常相似。比如:

   在VB 中:

   For Each objItem in colCollection

   ..执行一些代码

   next

   在C# 中:

   foreach (int i in arr1) {

   ..执行一些代码

   }

 

   Jump

   C# 中Jump 语句就象VB中的Goto 语句,用于从一个语句跳转到另一个语句。

   Break

   Break语句用来结束当前循环或者 switch 语句。

   Continue

   Continue语句跳过循环体中后面的程序行,继续执行循环。

   Return

   Return 语句返回到调用的程序,并返回一个数值。比如:

   class Test

   {

   Public bool TestMe()

   {

   ..执行一些代码

   return true

   }

   }

   Arrays

   在C# 中,创建数组变量的同时就可以对它们进行初始化。比如:

   int[] store={12}

   再看看多维数组的定义:matrix[0][3]=4;

 

   一个Identifier是用于程序元素的名字。如果我们必须在C# 代码中使用其它语言的保留字,就可以使用一个Identifier。 在下面的代码中,checked是一个关键字,@ 是Identifier:

   public void @checked()

   注释

   以下是C# 中的注释表示法,它与 Java 中的用法相同:

   // 这是一个单行的注释

   /*

   * 这是一个多行的注释

   */

   结 语

   OK,终于到站了。以上对C# 语言的概念、语法和使用上的描述,不知道是否对你有所帮助?VB开发者,你是否看到了熟悉的术语?如果答案是yes,我就欣慰了;-)




DeepSeek+Dify实战:零代码构建智能SQL生成器 本文详细介绍了如何利用DeepSeek和Dify零代码构建智能SQL生成器,帮助非技术人员通过自然语言查询数据库。文章涵盖从数据准备、知识库设计到Agent配置的全流程,并提供了优化技巧和实际应用案例,显著提升团队数据查询效率。 阅读详情

相关推荐

《Ventoy 制作系统安装 U 盘的具体步骤》

然后您可以在电脑的磁盘管理中对 U 盘进行快速格式化,选择 FAT32 或 NTFS 文件系统。至此,Ventoy 系统安装 U 盘就制作完成了。您可以在需要安装系统的电脑上,从 U 盘启动,然后选择相应的系统镜像进行安装。安装完成后,将您需要的操作系统镜像文件(如 Windows、Linux 等的 ISO 格式镜像)复制到 U 盘的根目录。在安装程序中,选择您插入的 U 盘设备,确保选择正确,以免误操作。2. 确认选择的 U 盘盘符正确,防止误操作导致其他磁盘数据丢失。点击“安装”按钮,等待安装完成。

jiyiwangluokeji的博客 2678

VB程序员眼中的C# 10(end) (转)

VB程序员眼中的C# 10(end) (转)[@more@]C# 中的While与 vb 中的While语句完全相同。当条件为真时,循环就执行。在一个While 循环内部可以使用 Break 语句跳出循环体或者使用Continu...

csd3176的博客 126

淘宝x-mini-wua生成机制与硬件信息关联性深度解析

本文深度解析了淘宝x-mini-wua的生成机制与硬件信息的关联性,详细介绍了其作为设备指纹令牌的核心作用及技术实现细节。通过分析基础硬件层、环境特征层和行为特征层的数据采集,揭示了淘宝如何利用AES加密和分级加密策略防止破解,并探讨了其安全防护与对抗策略。

weixin_29243279的博客 233

VB程序员眼中的C#

           VB程序员眼中的C#   一个程序通常有一个主函数,以表示程序的入口,它的名字一般是main。下面是一个简单的没有返回值的主函数,函数名前是void类型:   Using System;   Class Test   {   public static void Main()   {   Console.Writeline("Hello Unive

coolstar的调侃 1208

湿敏电阻HR202的两种驱动方案实测:IO充放电法 vs. 交流方波ADC法,哪个更适合你?

本文深入评测湿敏电阻HR202的两种驱动方案:IO充放电法和交流方波ADC法。通过原理图分析、精度实测和资源占用对比,揭示交流方波ADC法在精度和稳定性上的优势,特别适合长期监测场景。同时提供IO充放电法在资源受限情况下的应用建议,帮助工程师根据项目需求做出最优选择。

weixin_30421809的博客 468

史上最全的Logisim存储系统实验教程(基于华中科技大学计算机组成原理实验)内赋源码下载

本博客是最全的最好的解释的华中科技大学计算机组成实验存储系统实验,本博客给出了电路实现,也给出了使用电路的原因有利于新手学习十分详细。并且内赋源码下载。

qq_62325622的博客 2万+

VB程序员眼中的C# 7

   public sealed class x   {   }   Internal   如果将Internal 修饰符放在一个类或成员上,那么这个类或成员就只能被同一个汇编中的其它类使用。这与 VB 中的 Friend 修饰符相同。   Protected   Protected修饰符用于准许对从这个类中派生出来的类进行访问。   Internal Protecte

coolstar的调侃 1033

关于DHCP Option60的认识

<br />       最近在网络建设过程中,必须面对一个实际存在的问题:当只有一根线入户时,该如何解决CATV和宽带业务的共存呢?这时就要考虑用到DHCP Option60了,那么DHCP Option60到底是如何来实现业务区分的呢?<br />首先先来看下DHCP协议,在DHCP协议中,定义了一个option字段,该字段主要是用来扩展DHCP协议的,Option 60 (Vendor class identifier)是DHCP报文中的一个选项字段,code为60,可以标识终端类型,根据不同的终

luoyingchuan的专栏 7940

VB程序员眼中的C# 8

通过使用ReadOnly,我们可以在构造器或初始数中设置一个值,这个值以后就不能再被修改。   比如,我们将一个叫做Color 的属性设定为ReadOnly:   public static readonly Color Red;   Structs   C# 中的Struct 是一种合成数据类型,由一些元素或数据类型组成。我们可以将它与 VB 中的用户定义类型相比较。比如: 

coolstar的调侃 962

1.2 重叠因子:双重指数移动平均(Double Exponential Moving Average, DEMA)概念与Python实战

双重指数移动平均(Double Exponential Moving Average, DEMA)是一种改进的移动平均线指标,由Patrick Mulloy在1994年开发。相比传统的指数移动平均线(EMA),DEMA通过减少滞后性来提供更快的市场反应。它通过两次计算EMA并进行特殊组合来实现这一目标,可以在保持平滑性的同时减少滞后。

Kewin的博客 2171

【连接器专题】 EIA-364 系列标准的完整列表

EIA-364 系列标准在电子工业中具有重要的地位,为电子连接器和互连系统的测试和验证提供了统一的、可操作的流程和方法,有助于提高电子产品的质量和可靠性,促进了电子工业的发展

一点硬件 2664

VB程序员眼中的C# 3

   C# 中的事件与VB中的事件作用相同。但是在C# 中,任何类都可以产生一套事件,并且任何对象都可以捆绑这些事件。C# 中的事件是以Delegates为基础的。设计事件时,通常认为Delegates要接受两个参数:第一个参数是引起事件的对象,第二个参数是以个包含事件自变量的对象。   现在我们为一个事件定义一个Delegates,当有新邮件到来时将激活这个事件:   ===delega

coolstar的调侃 1347

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

VB程序员眼中的C# 4

   可以把Indexers看成是一个聪明的数组,当想要用类似于数组的方式通过索引存取一个属性时就可以使用Indexers。比如:   public double this[intindex]   Attributes   Attributes指的是放在源代码元素上的注解,与VB中的条件汇编相同。但是在 C# 中,Attributes信息是存储在元素的元数据中的,在运行时间可以用 re

coolstar的调侃 1043

深度学习工具包 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")

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

VB程序员眼中的C# 9

   在C# 中Switch 是分支判断语句,它类似于VB 中的‘Case’语句。比如:   在VB中:   Select Case X   Case 1   Func1   Case 2   Func 2   End Select   在C#中:   switch (x);   {   case 1:   func1();   break;

coolstar的调侃 1032

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

VB程序员眼中的C# 5

基础类是那些继承来的类。派生类是那些继承了一个基础类的类。   Constructor(构造器)   Constructor是一个方法,当构造一个类的一个对象时调用它,通常在初始化一个类时被使用。一个Constructor方法与类的名字相同、没有返回类型而且不返回任何值。   Ref 和 Out   将一个参数标记为 Ref 类型意味着对其值进行的任何修改都会维持,这与 VB 的‘

coolstar的调侃 961

VB程序员眼中的C# 3 (转)

VB程序员眼中的C# 3 (转)[@more@]   C# 中的事件与VB中的事件作用相同。但是在C# 中,任何类都可以产生一套事件,并且任何对象都可以捆绑这些事件。C# 中的事件是以Delegates为基础的。设计事件时,通常...

cuiji1279的博客 135

VB程序员眼中的C# (转)

VB程序员眼中的C# (转)[@more@] VB程序员眼中的C# 一个程序通常有一个主函数,以表示程序的入口,它的名字一般是main。下面是一个简单的没有返回值的主函数,函数名前是void类型:    Using S...

csd3176的博客 106
上一篇: VB程序员眼中的C# 9
下一篇: VB程序员眼中的C# 7
techweb
博客等级 码龄19年 226粉丝 3842原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值