vb.net公用代码 vbnet2015
请问Vb.net编程代码,不要C语言的,我看不懂啊?
Imports System
在敦煌等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供成都网站设计、网站建设 网站设计制作按需网站制作,公司网站建设,企业网站建设,品牌网站制作,成都营销网站建设,外贸网站建设,敦煌网站建设费用合理。
Module Program
Sub Main()
Dim n As Integer
n=6
Console.WriteLine("{0}!={1}",n,fact(n))
n=10
For i As Integer=1 To n
Console.Write("{0}{1}",fibo(i),IIF(n=i,vbCrLf,","))
Next
Console.Write("按任意键继续。。。 ")
Console.ReadKey(True)
End Sub
' 递归算阶乘
Function fact(n As Long) As Long
If 0=n OrElse 1=n Then Return 1
Return n*fact(n-1)
End Function
' 递归算斐波那契数列
Function fibo(n As Long) As Long
If 1=n OrElse 2=n Then Return 1
Return fibo(n-1)+fibo(n-2)
End Function
End Module
VB.NET中的代码
大概的过程:
Imports System.Data
Imports System.Data.SqlClient
--------------
Dim a As New SqlDataAdapter
Dim con As SqlConnection
con = New SqlConnection( "Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=.;Connect Timeout=30")
con.Open()
a.SelectCommand = New SqlCommand("select * from table where c=1", con)
a.UpdateCommand = New SqlCommand("update table set b=2 where c=1", con)
a.DeleteCommand = New SqlCommand("delete from table where c=1", con)
a.InsertCommand = New SqlCommand("insert into table values (1,2,3)", con)
a.SelectCommand.ExecuteNonQuery()
a.UpdateCommand.ExecuteNonQuery()
a.DeleteCommand.ExecuteNonQuery()
a.InsertCommand.ExecuteNonQuery()
con.Close()
a.Dispose()
跪求vb.net代码
新建窗口,添加picture控件
利用line()方法画线
line(开始x坐标,开始y坐标)-(结束x坐标,结束y坐标),线的颜色,画线的方式(默认为线,B为矩形无填充,BF为填充的矩形)
For i = 1 To 16
Picture1.Line (0, Picture1.Height / 2)-(i * (Picture1.Width / 16), 0), RGB(255, 0, 0)
Picture1.Line (0, Picture1.Height / 2)-(i * (Picture1.Width / 16), Picture1.Height), RGB(255, 0, 0)
Picture1.Line (Picture1.Width, Picture1.Height / 2)-(i * (Picture1.Width / 16), 0), RGB(0, 255, 0)
Picture1.Line (Picture1.Width, Picture1.Height / 2)-(i * (Picture1.Width / 16), Picture1.Height), RGB(0, 255, 0)
Next i
如果要在窗口上画也可以调用窗口的line方法即form.line()
分享题目:vb.net公用代码 vbnet2015
分享URL:http://myzitong.com/article/doeoihc.html