public function Calculate_CRC8(byval crc as uint16,byval n as uint16) as uint16
網(wǎng)站建設(shè)哪家好,找成都創(chuàng)新互聯(lián)!專注于網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、重慶小程序開發(fā)、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項(xiàng)目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了根河免費(fèi)建站歡迎大家使用!
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
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
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
Private?Sub?wmp_PlayStateChange(sender?As?Object,?e?As?AxWMPLib._WMPOCXEvents_PlayStateChangeEvent)
If?DirectCast(e.newState,?WMPLib.WMPPlayState)?=?WMPLib.WMPPlayState.wmppsReady?Then
wmp.Ctlcontrols.play()
End?If
End?Sub
Private?Sub?axWindowsMediaPlayer1_PlayStateChange(sender?As?Object,?e?As?AxWMPLib._WMPOCXEvents_PlayStateChangeEvent)
If?axWindowsMediaPlayer1.playState?=?WMPLib.WMPPlayState.wmppsMediaEnded?Then
Me.axWindowsMediaPlayer1.currentPlaylist.clear()
Me.axWindowsMediaPlayer1.currentPlaylist.appendItem(Me.axWindowsMediaPlayer1.newMedia("f:\b.wmv"))
axWindowsMediaPlayer1.settings.setMode("loop",?True)
timer1.Enabled?=?True
End?If
End?Sub
Private?Sub?timer1_Tick(sender?As?Object,?e?As?EventArgs)
timer1.Enabled?=?False
axWindowsMediaPlayer1.Ctlcontrols.play()
End?Sub
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)站超牛逼
有一個方法可以,就是麻煩些:
1.把你的C#項(xiàng)目編譯為dll或exe
2.使用reflector再反編譯你在1中生成的dll或exe
3.在reflector中再將反編譯的結(jié)果輸出為VB.NET項(xiàng)目.
這樣做,肯定是可以的,只是麻煩.
需要用到FileGenerator插件.
reflector的下載和使用,參考:
如果還有問題,hi我.
=============
補(bǔ)充,實(shí)在不行就加我啊,幫你遠(yuǎn)程做一遍,你就會了啊.
標(biāo)題名稱:c轉(zhuǎn)vb.net工具箱 vb轉(zhuǎn)c語言工具
鏈接分享:http://jinyejixie.com/article38/dodhdpp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設(shè)計(jì)、網(wǎng)站維護(hù)、建站公司、網(wǎng)站營銷、響應(yīng)式網(wǎng)站、網(wǎng)站導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)