System.Runtime.InteropServices.DllImport("user32.dll") _
创新互联建站始终坚持【策划先行,效果至上】的经营理念,通过多达10年累计超上千家客户的网站建设总结了一套系统有效的全网营销推广解决方案,现已广泛运用于各行各业的客户,其中包括:成都效果图设计等企业,备受客户赞誉。
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
授人以耐颤野渔:
这洞清个网站超牛逼
Public NotInheritable Class JSON
Private Sub New()
End Sub
Public Shared Function parse(Of T)(jsonString As String) As T
Using ms = New MemoryStream(Encoding.UTF8.GetBytes(jsonString))
Return DirectCast(New DataContractJsonSerializer(GetType(T)).ReadObject(ms), T)
搏饥裂 End Using
End Function
Public Shared Function stringify(jsonObject 肢册As Object) As String
Using ms = New MemoryStream()
基闭 New DataContractJsonSerializer(jsonObject.[GetType]()).WriteObject(ms, jsonObject)
Return Encoding.UTF8.GetString(ms.ToArray())
End Using
End Function
End Class
这需要三个步骤:
第一步:创建一个C#项目,在其中添加相应的窗体和引用,将VB2008中相应窗体上的控件复制到C#相应的窗体上;
第二步:使用C#与VB.NET转换工具软件或者大和到“”,将VB2008 的代码转换成C#代码。
第三步誉吵:工具软件或者在线转换,转换后的代码会有一些错误或者无法庆仿侍转换的部分,进行简单的人工修正。
OK,你成功了!
Option Explicit On
Option Strict On
Imports System
Module Program
Sub Main()
Dim y,m,t As Integer
begin:
' 输入数据时一行一个
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