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. php 根据子分类循环获取其父级分类

    /** * 根据子分类循环获取其父级分类 */ function goodsCatPath($catId, $data = []){ if($catId==0)return $data; $data[ ...

  2. Flask 数据库迁移

    在开发过程中,需要修改数据库模型,而且还要在修改之后更新数据库.最直接的方式就是删除旧表,但这样会丢失数据. 更好的解决办法是使用数据库迁移框架,它可以追踪数据库模式的变化,然后把变动应用到数据库中. ...

  3. 微信小程序授权流程(图)

    看图: 1. 前端H5调用JSSKD的方法  wx.login(), 2. 微信返回 临时登录凭证code 给前端H5 3. 将此Code给到开发者服务器 4. 服务器混同小程序的AppId 和 Ap ...

  4. python-哈夫曼树

    #!/usr/bin/python #coding=utf-8 #哈夫曼树创建 class Node(): def __init__(self,value,left=None,right=None): ...

  5. 设置spacevim字体显示乱码问题

    https://github.com/powerline/fonts clone powerline fonts 仓库 执行项目中的 install.sh 安装字体 修改终端配置中使用的字体为 xxx ...

  6. [笔记] Python基础---列表

    1.定义列表 列表由数据构成的有限序列,即按照一定的线性顺序排列,排列而成的数据项的集合. 2.创建列表 使用‘[ ]’括起来就已经创建了一个列表,例: my_first_list = [] #空列表 ...

  7. Linux下如何查看版本信息(转)

    Linux下如何查看版本信息, 包括位数.版本信息以及CPU内核信息.CPU具体型号等等,整个CPU信息一目了然.   1.# uname -a   (Linux查看版本当前操作系统内核信息)   L ...

  8. H5+MUI上传文件

    应用场景:MUI+H5+WEBAPI 今天在给我外甥女调手机端上传图片的时候,发现他是直接调用的MUI下的api,直接调取相册或者相机,到最后只看见了一个文件的路径,所以以前写的上传文件就不太好套上去 ...

  9. 小菜读书---《Effective C#:改善C#程序的50种方法》

    一.用属性代替可访问的字段 1..NET数据绑定只支持数据绑定,使用属性可以获得数据绑定的好处: 2.在属性的get和set访问器重可使用lock添加多线程的支持. 二.readonly(运行时常量) ...

  10. 第10天:apply和call、bind、函数作为参数、返回值使用、闭包、递归的样例

    apply和call apply和call都可以改变this的指向 函数的调用,改变this的指向 函数名字.apply(对象,[参数1,参数2,.....]) 方法名字.apply(对象,[参数1, ...