
正文
vb.net入门 vbnet入门经典网盘
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
vb.net入门之分组控件:GroupBox控件
我们对控件进行分组的原因不外乎三个
为了获得清晰的用户界面而将相关的窗体元素进行可视化分组
编程分组 如对单选按钮进行分组
为了在设计时将多个控件作为一个单元来移动
在中 有GroupBox Panel TabControl这三个控件可以实现上面所提到的三个分组目的 所以我们称它们为分组控件
这三个控件在功用上十分的相似 特别是GroupBox和Panel控件 只存在一点细微的差别而已(这个差别是 只有GroupBox控件可以显示标题 而只有Panel控件可以有滚动条) 这里我们就先来了解GroupBox控件的使用
GroupBox(控件组)控件一般是作为其他控件的组的容器的形式存在的 这样有利于用户识别 使界面变得更加友好(GroupBox控件相当于Visual Basic以前版本的Frame控件) 使用控件组控件可以将一个窗体中的各种功能进一步进行分类 例如 将各种选项按钮控件分隔开
当移动单个GroupBox控件时 它所包含的所有控件也将一起移动
在大多数情况下 对控件组控件没有实际的操作 我们用它对控件进行分组 通常没有必要响应它的事件 不过 它的Name Text和Font等属性可能会经常被修改 以适应应用程序在不同阶段的要求
GroupBox控件在工具箱中的图标如图所示
一 GroupBox控件的常用属性
Anchor和Dock 这两个属性是所有有用户界面的控件都有的定位属性 这里就不啰嗦了
Name属性 标识控件的对象名称
Text属性 显示在GroupBox控件右上方的标题文字 可以用来标识该控件组的描述
Font和ForeColor属性 用于改变GroupBox控件的文字大小以及文字的颜色 需要注意的时候 它不单改变GroupBox控件的Text属性的文字外观 同时也改变其内部控件的显示的Text属性的文字外观
二 创建一组控件
在窗体上放置GroupBox控件 从工具箱中拖放一个GroupBox控件到窗体上的合适位置 调整大小
在属性窗口中改变GroupBox控件的Text属性 作为它的标题
在GroupBox控件内拖放其它需要的控件 例如RadioButton控件
设置示例 如图一所示
图一 用控件组控件对单选按钮分组
我们在拖动单个GroupBox控件的时候 它内部的控件也会随着移动 以保持和GroupBox的相对位置不变 同理 删除GroupBox控件时 它所包含的所有控件也会被删除掉
当我们调整GroupBox控件所包含的控件的Anchor和Dock属性的时候 其参照物将不是Form窗体 而是GroupBox控件了
三 编程添加GroupBox控件以及它所包含的控件
虽然GroupBox控件是在设计时用视图设计布局效果最好 但是无可避免地 很多特殊情况下也是需要在运行做添加控件到控件组中的 这里我们就用代码来完成上图一界面的绘制
动态添加控件一般需要经过下面三个步骤
创建要添加的控件实例
设置新控件的属性
将控件添加到父控件的 Controls 集合
在Form 代码的任意位置增加初始化控件的过程InitializeControl() 代码如下所示
Sub InitializeControl()
首先添加Label和TextBox控件
Dim Label As New System Windows Forms Label
Dim TextBox As New System Windows Forms TextBox
Label
Label Location = New System Drawing Point( )
Label Name = Label
Label Size = New System Drawing Size( )
Label TabIndex =
Label Text = 户主姓名
TextBox
TextBox Location = New System Drawing Point( )
TextBox Name = TextBox
TextBox Size = New System Drawing Size( )
TextBox TabIndex =
TextBox Text =
把它们添加到父控件Form 的Controls集合中
Me Controls Add(TextBox )
Me Controls Add(Label )
添加三个GroupBox控件
Dim GroupBox As New System Windows Forms GroupBox
Dim GroupBox As New System Windows Forms GroupBox
Dim GroupBox As New System Windows Forms GroupBox
GroupBox
GroupBox BackColor = System Drawing SystemColors Control
GroupBox Location = New System Drawing Point( )
GroupBox Name = GroupBox
GroupBox Size = New System Drawing Size( )
GroupBox TabIndex =
GroupBox TabStop = False
GroupBox Text = 性别
GroupBox
GroupBox Location = New System Drawing Point( )
GroupBox Name = GroupBox
GroupBox Size = New System Drawing Size( )
GroupBox TabIndex =
GroupBox TabStop = False
GroupBox Text = 单元
GroupBox
GroupBox Location = New System Drawing Point( )
GroupBox Name = GroupBox
GroupBox Size = New System Drawing Size( )
GroupBox TabIndex =
GroupBox TabStop = False
GroupBox Text = 楼层
把它们添加到父控件Form 的Controls集合中
Me Controls Add(GroupBox )
Me Controls Add(GroupBox )
Me Controls Add(GroupBox )
添加RadioButton控件并分别绘制在GroupBox控件内
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 男性
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 女性
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 二单元
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 三单元
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 一单元
RadioButton
RadioButton BackColor = System Drawing SystemColors Control
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 四单元
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 二楼
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 三楼
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 一楼
RadioButton
RadioButton BackColor = System Drawing SystemColors Control
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 四楼
分别把它们添加到父控件GroupBox的Controls集合中
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
End Sub
把上一页的代码复制添加后 把控件初始化过程InitializeControl()过程添加到Form 的New构造函数中 如下图二所示
图二 在New构造函数中添加过程InitializeControl()
现在按F 运行 Form 的窗体控件布局(如下图三所示)是不是和我们手工布局的图一的布局是一样的呢?
lishixinzhi/Article/program/ASP/201311/21749
相关问答
Q1: 学习VB.NET要多久
弟你好:
我是在微软做教材的员工,据我了解学习.NET入门并不难。如果你了解JAVA这门语言,那么学习会很轻松。如果没有接触过面向对象编程可能就要麻烦一点点。大概也就是1个月左右便可以入门。因为基本上你要是学习VB.NET的话,除了部分语法可以借鉴老的VB,其他基本都要抛弃。但是不会很困难。最重要的就是理解.NET运行原理,掌握语法和部分常用类库就可以了。
看你所述你似乎想要做网站。市场行情来看,人家免费论坛都已经发布源码很多了,无论是ASP还是.NET开发,都变得非常容易。如果想从这方面就业,前景也不是很乐观。其实如果不是很麻烦的网站,微软OFFICE组件中的SharePoint Server就可以完全满足要求。根本不需要懂多少编程。
如果想从事工作,还是推荐学习VS.NET 2005和SQL Server 2005。
以上是哥哥的愚见,希望对你有所帮助
求采纳为满意回答。
Q2: VB.Net编程实现Web Service的基础
WebService目前可是目前计算机界一个非常流行vb.net入门的技术vb.net入门了 以至于有些人把WebService列入目前最热门的十大技术之一 的确随着互联网的广泛应用和发展 尤其是电子商务的发展 出于互联网上各种复杂的应用系统和对更高安全性的要求 WebService的横空出世的确满足vb.net入门了当前这些的要求和需要 其中的原因在下文中有详细的介绍 本文的主要内容是简要介绍一下WebService的相关知识 以及使用VisualBasic Net实现WebServices的具体方法和典型步骤
一 WebService为何物 vb.net入门我们为什么需要它
WebService的主要功能就是可以实现实现跨平台的功能调用 同时由于WebService中使用XML来进行数据交换 所以在使用WebService时不用担心防火墙的影响 由于WebService集成vb.net入门了各种功能 并提供了一个友好的界面 所以在WebService能够实现软件的重用
另外WebService的调用非常简单 简而言之调用互联网上的WebService就如同调用本地的组件一样简单 就是通过HTTP协议来调用互联网上的组件 至于具体的调用方法 请参阅本文第五节第七段的内容 所以Web Service就是互联网上的组件调用
二 和Web Service相关的标准 协议
Web Service是通过一系列标准和协议来保证和程序之间的动态连接和实现其安全调用的 其中主要的标准和协议是 XML WSDL SOAP HTTP UDDI 下面就简要介绍这些标准和协议
XML Web Service之间和Web Service和应用程序之间都是采用XML进行数据交换的 Web Service由于基于了XML 这样Web Service在具备XML带来的优势的同时 也拥有了由于XML所带来的缺点 其中XML所带来的最重要缺点就是Web Service将大量的占有CPU的资源 因为XML数据要经过多步处理才能被系统使用 所以 即使调用一个功能较小的Web Service 也会感觉速度很慢 所以网络中对运行Web Service的主机要求是很高的
HTTP 应用程序是提供HTTP协议来调用Web Service的 所以HTTP在Web Service调用过程中 起著通道的作用
WSDL 是Web Service描述语言的简写 它是XML格式 其作用是描述Web Service 指示应用程序和与Web Servie交互的方法 当实现了某种Web Service服务时 为了让别的程序调用 就必须告诉此Web Service的接口 如 服务名称 服务所在的机器名称 监听端口号 传递参数的类型等等 WSDL就是规定了有关Web Services描述的标准
UDDI 是Universal Description Discovery and Integration的缩写 简单说 UDDI用于集中存放和查找WSDL描述文件 起著目录服务器的作用
SOAP 是 Simple Object Access Protocol 的缩写 即 简单对象访问协议 SOAP是一种消息传递的协议 它规定了Web Services之间传递信息的方式
三 本文章的程序设计 调试和运行的环境
( ) 微软公司视窗 中文企业版
( ) Visual Studio Net 企业构建版 Net FrameWork SDK 版本号
( ) IIS服务启动
四 Visual Basic Net实现Web Service
Net 的大的推动了Web Service的发展 而Visual Studio Net的出现又极大的推动了Web Service的的广泛应用 在Visual Studio Net推出之前 编写一个Web Service是一项非常复杂的工作 同样调用这个Web Service也十分麻烦 由于Visual Studio Net对Web Service提供了较强的支持 很多细致 烦杂的工作都由Visual Studio Net自动完成了 这样就使得上述工作变得非常简单 甚至不了解Web Service和其相关的标准 协议 也可以使用Visual Studio Net编写Web Service 并使用这个Web Service 下面就来用Visual Basic Net实现一个Web Service 此Web Service和数据库相关 数据库类型选用的是Sql Server 此Web Service提供了二个函数功能调用 其一名称为Binding 用以实现数据绑定 其二名称为Update 用以更新数据库中的数据
以下就是Visual Basic Net实现此Web Service的具体步骤
启动Visual Studio Net
选择菜单「文件」|「新建」|「项目」后 弹出「新建项目」对话框
将「项目类型」设置为「Visual Basic项目」
将「模板」设置为「ASP NET Web 服务」
在「位置」的文本框中输入//localhost/UpdateDataWebService 后 单击「确定」按钮 这样在Visual Studio Net就会计算机Internet信息服务的默认目录中创建一个名称为 UpdateDataWebService 文件夹 里面存放的是此项目的文件 具体如图 所示
图 创建Web Service项目对话框
选中「解决方案资源管理器」中的 Service a *** x 文件 单击鼠标右键 在弹出的菜单中选择「查看代码」 则进入Service a *** x vb的编辑界面
在Service a *** x……vb的首部 在导入命名空间的代码区中添加下列代码 下列代码作用是导入命名空间System Data SqlClient
Imports System Data SqlClient
在Service a *** x……vb文件的 Public Class Service Inherits System Web Services WebService 代码后 添加下列代码 下列代码是在Web Service中定义二个功能调用
WebMethod ( ) Public Function Binding ( ) As DataSet Dim con As New SqlConnection ( Server = localhost ; uid = sa ; pwd = ; database = northwind ) Dim daCust As New SqlDataAdapter ( Select * From Customers con ) Dim ds As New DataSet ( ) daCust Fill( ds Cust ) Return dsEnd FunctionWebMethod ( ) Public Function Update ( ByVal ds As DataSet ) As DataSet Dim con As New SqlConnection ( Server = localhost ; uid = sa ; pwd = ; database = northwind ) Dim daCust As New SqlDataAdapter ( Select * From Customers con ) Dim cbCust As New SqlCommandBuilder ( daCust ) daCust Update ( ds Cust ) Return dsEnd Function
保存上述的修改 一个简单的操作Sql Server数据库的Web Service就完成了 此时单击快捷键F 此Web Service就开始运行 并可以对外提供服务了 具体如图 所示:
图 :Web Service提供服务是的界面
Service a *** x vb的代码清单如下:
Imports System Web ServicesImports System Data SqlClientWebService ( Namespace := ) _Public Class Service Inherits System Web Services WebServiceWebMethod ( ) Public Function Binding ( ) As DataSet Modify this Connection string to use your SQL Server and log on Dim con As New SqlConnection ( Server=localhost;uid=sa;pwd=;database=northwind ) Dim daCust As New SqlDataAdapter ( Select * From Customers con ) Dim ds As New DataSet ( ) daCust Fill ( ds Cust ) Return dsEnd FunctionWebMethod ( ) Public Function Update ( ByVal ds As DataSet ) As DataSet Dim con As New SqlConnection ( Server=localhost;uid=sa;pwd=;database=northwind ) Dim daCust As New SqlDataAdapter ( Select * From Customers con ) Dim cbCust As New SqlCommandBuilder ( daCust ) daCust Update ( ds Cust ) Return dsEnd Function#Region Web 服务设计器生成的代码 Public Sub New ( ) MyBase New ( ) 该调用是 Web 服务设计器所必需的 InitializeComponent ( ) 在 InitializeComponent ( ) 调用之后添加您自己的初始化代码End Sub Web 服务设计器所必需的Private ponents As System ComponentModel IContainer 注意 以下过程是 Web 服务设计器所必需的 可以使用 Web 服务设计器修改此过程 不要使用代码编辑器修改它 System Diagnostics DebuggerStepThrough ( ) Private Sub InitializeComponent ( ) ponents = New System ComponentModel Container ( )End SubProtected Overloads Overrides Sub Dispose ( ByVal disposing As Boolean ) CODEGEN: 此过程是 Web 服务设计器所必需的 不要使用代码编辑器修改它 If disposing Then If Not ( ponents Is Nothing ) Thenponents Dispose ( ) End IfEnd IfMyBase Dispose ( disposing )End Sub#End Region Web 服务示例 HelloWorld ( ) 示例服务返回字符串 Hello World 若要生成项目 请取消注释以下行 然后保存并生成项目 若要测试此 Web 服务 请确保 a *** x 文件为起始页 并按 F 键 WebMethod ( ) Public Function HelloWorld ( ) As String HelloWorld = Hello World End FunctionEnd Class
下面就来介绍Visual Basic Net中使用这个Web Service提供的服务来更新数据库的实现方法
五 在Visual Basic Net调用Web Service提供的服务:
当Web Service已经处于对外提供服务状态 Visual Basic Net就可以通过HTTP 调用 来使用这些服务了 当然前提是要了解Web Service对外提供服务所对应的URL 当了解到Web Service对应的URL后 Visual Basic Net就像是使用本地的类库一样使用Web Service中提供的各种功能 所以有些人说 Web Service从实质上说 就是通过HTTP调用远程组件的一种方式 在Visual Basic Net具体实现加入Web Service可参阅下面步骤中的第七步
在下面介绍的这个数据库应用程序是通过使用上面的Web Service中提供的 Binding 服务 对程序中DataGrid组件实现数据绑定 提供使用Web Service中提供的 Update 服务 通过程序中的DataGrid来修改数据库 下面就是Visual Basic Net中使用Web Service提供服务来编写数据库应用程序的具体步骤 :
启动Visual Studio Net
选择菜单【文件】|【新建】|【项目】后 弹出【新建项目】对话框
将【项目类型】设置为【Visual Basic项目】
将【模板】设置为【Windows应用程序】
在【名称】文本框中输入【TestWebService】
在【位置】的文本框中输入【E:\VS NET项目】 然后单击【确定】按钮 这样在 E:\VS NET项目 中就产生了名称为 TestWebService 文件夹 里面存放的就是TestWebService项目的所有文件
选择【解决方案资源管理器】|【引用】后 单击鼠标右键 在弹出的菜单中选择【添加Web 引用】 在弹出的【添加Web引用】对话框中的【地址】文本框中输入 后 单击回车键后 可得图 所示界面 单击图 中【添加引用】按钮 则在【TestWebService】项目中加入了Web引用 请注意 就是上面完成的Web Service对外提供服务的URL地址 具体可参阅图 所示:
图 :在【TestWebService】添加Web Service提供的服务
从【工具箱】中的【Windows窗体组件】选项卡中往Form 窗体中拖入下列组件 并执行相应的操作:
一个DataGrid组件
二个Button组件 分别是Button 至Button 并在这二个Button组件拖入Form 的设计窗体后 分别双击它们 则系统会在Form vb文件分别产生这二个组件的Click事件对应的处理代码
按照表 所示调整窗体中各组件属性的数值
组件类型 组件名称 属性 设置结果 Form Form Text 测试Web Service Form MaximizeBox False Form FormBorderStyle FixedSingle Button Button Text 绑定 Button FlatStyle Flat Button Text 修改 Button FlatStyle Flat
表 :【TestWebService】项目中组件的主要属性及其对应数值
在调整完组件属性值后 再按照图 所示调整组件的位置和排列顺序:
图 :【TestWebService】项目中组件排列位置和顺序
把Visual Studio Net的当前窗口切换到Form vb的代码编辑窗口 并用下列代码替换Form vb中的Button 的Click事件对应的处理代码 下列代码功能是使用Web Service中提供的 Binding 服务对DataGrid组件实现数据绑定:
Private Sub Button _Click ( ByVal sender As System Object ByVal e As System EventArgs ) Handles Button Click Dim MyService As New localhost Service ( ) DataGrid DataSource = MyService Binding ( ) DataGrid DataMember = Cust End Sub
用下列代码替换Form vb中的Button 的Click事件对应的处理代码 下列代码功能是使用Web Service中提供的 Update 服务实现通过DataGrid来修改数据库数据:
Private Sub Button _Click ( ByVal sender As System Object ByVal e As System EventArgs ) Handles Button Click Dim MyService As New localhost Service ( ) Dim ds As DataSet = DataGrid DataSource Dim dsChanges As DataSet = ds GetChanges ( ) If Not ( dsChanges Is Nothing ) Thends Merge ( MyService Update ( dsChanges ) True ) End IfEnd Sub
至此 【TestWebService】项目的全部工作就完成了 调用Web Service是不是很简单 此时单击快捷键F 运行程序后 单击程序中的【绑定】按钮就会对程序中的DataGrid组件实现数据绑定 单击程序中的【修改】按钮 则程序会根据DataGrid中的内容来更新数据库 图 就是【TestWebService】的运行界面:
图 :【TestWebService】的运行界面
Form vb的代码清单如下:
Public Class Form Inherits System Windows Forms Form#Region Windows 窗体设计器生成的代码 Public Sub New ( ) MyBase New ( ) 该调用是 Windows 窗体设计器所必需的 InitializeComponent ( ) 在 InitializeComponent ( ) 调用之后添加任何初始化End Sub 窗体重写处置以清理组件列表 Protected Overloads Overrides Sub Dispose ( ByVal disposing As Boolean ) If disposing ThenIf Not ( ponents Is Nothing ) Then ponents Dispose ( )End If End If MyBase Dispose ( disposing )End Sub Windows 窗体设计器所必需的Private ponents As System ComponentModel IContainer 注意 以下过程是 Windows 窗体设计器所必需的 可以使用 Windows 窗体设计器修改此过程 不要使用代码编辑器修改它 Friend WithEvents Button As System Windows Forms Button Friend WithEvents Button As System Windows Forms Button Friend WithEvents DataGrid As System Windows Forms DataGrid System Diagnostics DebuggerStepThrough ( ) Private Sub InitializeComponent ( ) Me Button = New System Windows Forms Button ( ) Me Button = New System Windows Forms Button ( ) Me DataGrid = New System Windows Forms DataGrid ( ) CType ( Me DataGrid System ComponentModel ISupportInitialize ) BeginInit ( ) Me SuspendLayout ( ) Me Button FlatStyle = System Windows Forms FlatStyle Flat Me Button Location = New System Drawing Point ( ) Me Button Name = Button Me Button Size = New System Drawing Size ( ) Me Button TabIndex = Me Button Text = 绑定 Me Button FlatStyle = System Windows Forms FlatStyle Flat Me Button Location = New System Drawing Point ( ) Me Button Name = Button Me Button Size = New System Drawing Size ( ) Me Button TabIndex = Me Button Text = 修改 Me DataGrid DataMember = Me DataGrid Dock = System Windows Forms DockStyle Top Me DataGrid HeaderForeColor = System Drawing SystemColors ControlText Me DataGrid Name = DataGrid Me DataGrid Size = New System Drawing Size ( ) Me DataGrid TabIndex = Me AutoScaleBaseSize = New System Drawing Size ( ) Me ClientSize = New System Drawing Size ( ) Me Controls AddRange ( New System Windows Forms Control ( ) {Me DataGrid Me Button Me Button } ) Me Name = Form Me Text = 测试Web Service CType ( Me DataGrid System ComponentModel ISupportInitialize ) EndInit ( ) Me ResumeLayout ( False )End Sub#End RegionPrivate Sub Button _Click ( ByVal sender As System Object ByVal e As System EventArgs ) Handles Button Click Dim MyService As New localhost Service ( ) DataGrid DataSource = MyService Binding ( ) DataGrid DataMember = Cust End SubPrivate Sub Button _Click ( ByVal sender As System Object ByVal e As System EventArgs ) Handles Button Click Dim MyService As New localhost Service ( ) Dim ds As DataSet = DataGrid DataSource Dim dsChanges As DataSet = ds GetChanges ( ) If Not ( dsChanges Is Nothing ) Thends Merge ( MyService Update ( dsChanges ) True ) End IfEnd SubEnd Class
六 总结
lishixinzhi/Article/program/net/201311/11839
Q3: 想学习vb.net,有什么好书推荐一下呗,讲解详细的,我是小白。谢谢啦
VB包含的内容很广泛,作为入门,你可以看一些基础类的书籍,如清华在学出版社 谭浩强的《VISUAL BASIC程序设计》,这一般是大学的入门教材,其它的你可以看一些带有光盘或源程序的参考类图书,如《VISUAL BASIC 6.0 应用编程150例》等等。
入门后,可根据你想要学习的方向看一些专业性的书籍,如你想搞数据库开发,可看一些数据库开发类的图书,而且还要学习数据库的操作,买一些数据管理方面的书,如sql server 2000自学教程等。
同时,做数据库方面的程序,最好还要学一些报表工具的操作与设计,如水晶报表《crystal report水晶报表设计与开发实务》。
Q4: VB.net 和C#.net 各有什么优缺点
C#.net优点:
运算符重载。不安全代码(指针和固定内存区)、 无符号整数、移位运算。
VB的优点:
即时编译、静态事件绑定、条件异常捕获、COM兼容类、宽松的类型检查和变量声明、VisualBasicRuntime库、可选参数、带参数属性、模块等语言特征、动态数组。
通过VB.NET开发好的程序绝对没有问题(包括DirectX游戏开发)。虽然VB.NET的资料少,但是只要C#支持的VB.NET都支持(大体上这样,因为都要经过MSIL中间环节。除了指针之类的VB.NET不支持C#支持,但是没有多大实际用处)。
vb.net的资料以英文资料居多(只有英文资料才有看头,中国的没有什么好资料),得看看英文水平过不过关。还有VB.NET的ide也比C#的IDE好得多,代码看得也舒服。(C#的大括号{}太烦人)。
至于VB6对C的帮助,只是理解上会容易一些,其它用处不大。有VB6的基础学VBNET会方便一些,但是并不是会VB6就会VB.NET,它们差别也不小。
扩展资料:
NET、C#和ASP.NET之间的区别:
1、NET是一个平台,一个抽象的平台的概念。
NET平台其本身实现的方式其实还是库,抽象层面上来看是一个平台。
基本可以理解的NET核心就是NETFramwork。
NETFramework包括两个关键组成元素:
a.CommonLanguageRuntime,公共语言运行时(CLR0)-提供内在管理,代码安全性检测等功能。
b.NETFrameworkClassLibrary,.NET框架类库(FLC)-提供大量应用类库,提高开发效率。
学习NETFramework是所有.NET开发人员都必须的,否则开发NET程序永远都是停留在‘外功’的招式,NETramework是NET开发高手的‘内功’修行之一。
2、C#是一个程序设计语言,仅仅是一个语言。
程序设计语言仅仅是为了方便开发人员和计算机沟通的工具,虽然C#语法相对C和 C+要多一些,但是相对来看C#语法都比较固定,这样使用起来却都很容易。我认可一位朋友说的,C#的语法更严谨!
这里回过来看看NET和C#的关系,不得不提的是NET程序的执行过程。
C#符合NETCLR中的公共语言运行规范。CLS:commonlanguagespecification,当然所有的NETLanguage都是符合这个规范的例如:VB.NET、XAML和C++/CL等等。
C#需要符合NETCLS,是因为NETCLR和JAVA虚拟机类似,有一个中间语言共机器来执行。所有不同语言的.NET代码在执行前会被编译成同样的中间语言(MSIL),所以所有NET支持语言都必须符合符合CLS规范。
P.S:如果做.NET3.0XAML开发的朋友,可以尝试下ildasm.exe看看XAML的应用程序,会发现原来XAML其实很简单。
3、ASP.NET是一个网站开发的技术,仅仅是.NET框架中的一个应用模型。
用微软公司ASP.NET快速入门中的一句话来解释,ASP.NET是用于生成基于Web的应用程序的内容丰富的编程框架。
ASP.net和C#的区别:
编写asp.net通常包括两部分的代码:网页层和后台处理层,网页就是用标记语言来写的,而网页对应的后台处理程序则需要.net语言来完成,目前主要是采用c#和vb.net。
可以说整个的asp.net网站通过c#或者vb.net来实现。而c#则是ms.netframework的主要语言,可以用在网站,桌面应用等方面。可以算是一种比较流行的编程语言。
关于vb.net入门和vbnet入门经典网盘的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。






