Difference Between C# and VB.NET Namespace

VB.NET

  • [Class Namespace in IL]=[Root Namespace].[Namespace in File]
  • Class is not automatically added namespace, root namespace is added in background.
  • Root namespace is setted at Application Tab of Project Properties.

C#

  • [Class Namespace in IL]=[Namespace in File]
  • Class is automatically added root namespace.
  • Root namespace is setted at Application Tab of Project Properties.

Options

Option Strict On
Option Explicit On

Erase Statement

Used to release array variables and deallocate the The Erase statement dates from old versions of Basic, the kind where manual memory management was useful.

No more, memory management is automatic in .NET. It is still supported for compatibility reasons.

All it does is set the array reference to Nothing. memory used for their elements.

Erase arraylist

Set Variable Name as Keyword

  • use square brackets
private [Date] as string

Get Base Class Private Field

correct: Me.GetType().BaseType().GetField("fieldName", BindingFlags.NonPublic Or BindingFlags.Instance)

uncorrect: MyBase.GetType().GetField("fieldName", BindingFlags.NonPublic Or BindingFlags.Instance)

VB.NET Syntax Tips的更多相关文章

  1. ASP.NET Razor - C# and VB Code Syntax

    http://www.w3schools.com/aspnet/razor_syntax.asp Razor supports both C# (C sharp) and VB (Visual Bas ...

  2. log4net Tutorial

    Introduction One of the greatest logging tools out there for .NET is log4net. This software is the g ...

  3. vim vimrc

    set nu set shiftwidth= set tabstop= set softtabstop= set autoindent set cindent set smartindent file ...

  4. [VB.NET Tips]为VB.NET正名

    前言 我于2005年毕业,正值全国上上下下如火如荼的开展企业信息化的时代,正是大规模软件开发的年代. 那时.NET 已经发布了2.0,但是仍是VB6,Delphi,PowerBuilder的天下,是E ...

  5. [VB.NET Tips]对多行文本的支持

    从Visual Studio 2008开始VB.NET支持多行文本. 用法如下: Dim mString As String = <string>我是 一个多 行文本.</strin ...

  6. [VB.NET Tips]对于基本数据类型的提示

    1.类型字符 有时需要直接量后面加上类型字符以明确指定类型,下面把常用的类型字符列出来 类型 字符 Short S Integer I Long L Decimal D Char c Single F ...

  7. [VB.NET Tips]程序的启动和终止

    当执行一个VB.NET应用程序时,CLR会把IL翻译成x86指令,并且寻找一个名为Main的方法. 并从该方法开始执行程序.Main方法也称为程序的"入口"(entry point ...

  8. [VB.NET Tips]VB.NET专有的字符串处理函数

    .NET Framework类库中含有专门为Visual Basic.NET程序员设计的函数和过程. 这些方法虽然是为VB.NET程序员设计的,但是也可以被.NET Framework上支持的任何语言 ...

  9. [VB.NET Tips]字符串转换为日期

    有些字符串需要转换成日期,或者整型转换为日期,可以参考如下思路: Dim result As Date Dim source As String = "20190515" resu ...

随机推荐

  1. (二)Audio子系统之new AudioRecord()

    在上一篇文章<(一)Audio子系统之AudioRecord.getMinBufferSize>中已经介绍了AudioRecord如何获取最小缓冲区大小,接下来,继续分析AudioReco ...

  2. dubbo服务暴露过程

    所谓服务暴露最终做的事情:绑定网络端口,开启serversokect服务以接收外部请求 服务暴露时序图 本地暴露 远程暴露 整体总结 dubbo服务提供者暴露服务的主过程:首先 ServiceConf ...

  3. Table '.\gts\eventdata#P#p0' is marked as crashed and last (automatic?) repair failed

    修复数据表操 MYSQL数据表出现问题,提示:Error: Table './db_name/table_name' is marked as crashed and last (automatic? ...

  4. Struts2 ongl内存结构

    valuestack是OgnlValueStack的实现,而OgnlValueStack是基于ValueStack的实现 valuestack的内存结构为: 里面主要的为:context和root r ...

  5. mysql8.0关闭log-bin功能

    一.查看log-bin是否开启: mysql> show variables like 'log-bin'; 二.关闭log-bin: 在配置文件中的 [mysqld] 配置节中增加 skip- ...

  6. 如何花二十分钟使用Hexo搭建个人博客

    前提条件: 你必须得有一个github账户 你的电脑上要安装了git和nodejs 你也可以达到这样的效果:https://liubinpy.github.io/ 第一步 进入一个你觉得比较安全的目录 ...

  7. 为什么会出现__pycache__文件夹?

    为什么会出现__pycache__文件夹? python解释器会将 *.py 脚本文件进行编译,并将编译结果保存到__pycache__目录中. 下次再执行工程时,若解释器发现这个 *.py 脚本没有 ...

  8. ASP.ENT前台更改绑定数据的日期格式

    1.Eval和Bind的区别 绑定表达式 < %# Eval("字段名") %> < %# Bind("字段名") %> 区别 1.ev ...

  9. [转]C# 6.0 的新特性

    本文的内容包括引入C#6.0中的新的语言特性有哪些. 还有已经被引入的代码名称为 “Roslyn”新编译器. 编译器是开放源码的,并且可以从 codeplex 网站的这个地址下载到源代码: https ...

  10. [javaSE] IO流(RandomAccessFile)

    随机访问文件,可以看作一个大型的byte[]数组,不算是IO体系中的一员,内部封装了字节输入输出流,可以设置权限,可以调整指针的位置 获取RandomAccessFile对象,构造参数:String文 ...