c源代碼轉(zhuǎn)vb.net c語言代碼轉(zhuǎn)換器

C#代碼轉(zhuǎn)換成VB.net,事件注冊處理方法

'api.OnFrontConnected?+=?new?FrontConnected(OnFrontConnected);

成都創(chuàng)新互聯(lián)公司,專注為中小企業(yè)提供官網(wǎng)建設、營銷型網(wǎng)站制作、成都響應式網(wǎng)站建設、展示型成都網(wǎng)站建設、成都網(wǎng)站制作等服務,幫助中小企業(yè)通過網(wǎng)站體現(xiàn)價值、有效益。幫助企業(yè)快速建站、解決網(wǎng)站建設與網(wǎng)站營銷推廣問題。

AddHandler?api.OnFrontConnected,?AddressOf?OnFrontConnected

C語言轉(zhuǎn)換為VB.NET

Option Explicit On

Option Strict On

Imports System

Module Program

Sub Main()

Dim y,m,t As Integer

begin:

' 輸入數(shù)據(jù)時一行一個

y=CInt(Console.ReadLine())

m=CInt(Console.ReadLine())

t=CInt(Console.ReadLine())

If y

200 Then

Console.WriteLine("ERROR")

goto begin

End If

pr(y,m,t)

Console.Write("Press any key to continue . . . ")

Console.ReadKey(True)

End Sub

Function pr(y As Integer,m As Integer,t As Integer) As Integer

Dim ye,[Me],i As Integer

ye=CInt((m+t-2)/12+y)

[Me]=(m+t-2) Mod 12+1

End If

End Function

Function mday(y As Integer,m As Integer) As Integer

Dim day As Integer()={0,31,28,31,30,31,30,31,31,30,31,30,31}

Dim ad As I

請幫忙將以下C語言代碼轉(zhuǎn)換為VB.NET代碼,謝謝!

Option Explicit On

Option Strict On

Imports System

Module Program

Sub Main()

Dim y,m,t As Integer

begin:

' 輸入數(shù)據(jù)時一行一個

y=CInt(Console.ReadLine())

m=CInt(Console.ReadLine())

t=CInt(Console.ReadLine())

If y100 Then

y=y+2000

End If

If y1916 OrElse m200 Then

Console.WriteLine("ERROR")

goto begin

End If

pr(y,m,t)

Console.Write("Press any key to continue . . . ")

Console.ReadKey(True)

End Sub

Function pr(y As Integer,m As Integer,t As Integer) As Integer

Dim ye,[Me],i As Integer

ye=CInt((m+t-2)/12+y)

[Me]=(m+t-2) Mod 12+1

Console.WriteLine(" {0}-{1} ~ {2}-{3}",y,m,ye,[Me])

ye=y

[Me]=m

For i=0 To t-1

prmonth(ye,[me])

[Me]=[Me]+1

If [Me]12 Then

ye=ye+1

[me]=1

End If

Next

Return 0

End Function

Function yam(y As Integer,m As Integer) As Integer

Dim st As String()={"未定義","一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"}

Console.WriteLine(" {0} {1}",y,st(m))

Console.WriteLine("----------------------------")

Return 0

End Function

Function ryear(y As Integer) As Integer

If 0=y Mod 400 OrElse (0y Mod 100 AndAlso 0=y Mod 4) Then

Return 1

Else

Return 0

End If

End Function

Function mday(y As Integer,m As Integer) As Integer

Dim day As Integer()={0,31,28,31,30,31,30,31,31,30,31,30,31}

Dim ad As Integer=0

If 2=m Then

ad=ryear(y)

End If

Return day(m)+ad

End Function

Function monday(y As Integer,m As Integer) As Integer

Dim md As Integer=6

Dim i,daynum As Integer

For i=1916 To y-1

daynum=365+ryear(i)

md=(md+daynum) Mod 7

Next

For i=1 To m-1

md=(md+mday(y,i)) Mod 7

Next

Return md

End Function

Function prmonth(y As Integer,m As Integer) As Integer

Dim md As Integer=monday(y,m)

Dim daysnum As Integer=mday(y,m)

Dim days As Integer=daysnum+md

Dim i As Integer

yam(y,m)

Console.Write(" 日 一 二 三 四 五 六")

For i=0 To days-1

If 0=i Mod 7 Then

Console.WriteLine()

Console.WriteLine()

Console.Write(" ")

End If

If i-md=0 Then

Console.Write(" {0,2}",i-md+1)

Else

Console.Write(" ")

End If

Next

Console.WriteLine()

Console.WriteLine()

Return 0

End Function

End Module

請大俠幫我將C代碼轉(zhuǎn)換成VB.Net,謝謝!

public function Calculate_CRC8(byval crc as uint16,byval n as uint16) as uint16

dim i as uint16

crc=crc xor n

for i=0 to 7

if crc and 1 then

crc=(crc1) xor H8c

else

crc=crc1

end if

next

return crc

end function

怎樣將以下的C#.net類代碼(.cs)轉(zhuǎn)換成vb.net(.vb) public static

Public Shared Function GetAllusers() As MembershipUserCollection

Dim a As Integer = Membership.GetAllUsers().Count

GetAllusers = Membership.GetAllUsers(0, 5, a)

End Function

Public Shared Function GetUser() As MembershipUser

GetUser = Membership.GetUser()

End Function

C# to vb.net 代碼轉(zhuǎn)換

System.Runtime.InteropServices.DllImport("user32.dll") _

Public Shared Function SetWindowLong(hWnd As IntPtr, nIndex As Integer, wndproc As Integer) As Integer

End Function

System.Runtime.InteropServices.DllImport("user32.dll") _

Public Shared Function GetWindowLong(hWnd As IntPtr, nIndex As Integer) As Integer

End Function

Public Const GWL_STYLE As Integer = -16

Public Const WS_DISABLED As Integer = H8000000

Public Shared Sub SetControlEnabled(c As Control, enabled As Boolean)

If enabled Then

SetWindowLong(c.Handle, GWL_STYLE, (Not WS_DISABLED) And GetWindowLong(c.Handle, GWL_STYLE))

Else

SetWindowLong(c.Handle, GWL_STYLE, WS_DISABLED + GetWindowLong(c.Handle, GWL_STYLE))

End If

End Sub

授人以漁:

這個網(wǎng)站超牛逼

網(wǎng)頁名稱:c源代碼轉(zhuǎn)vb.net c語言代碼轉(zhuǎn)換器
文章URL:http://muchs.cn/article48/docdghp.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供軟件開發(fā)、網(wǎng)站收錄、動態(tài)網(wǎng)站、品牌網(wǎng)站設計云服務器、微信小程序

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設