Dim maDate As New DateTime(Now.Year, Now.Month, Now.Day, CType(Me.TextBox1.Text, Integer), 0, 0) Dim maChaine as String = maDate.ToString("HH:mm")
Dim d As DateTime Dim d2 As DateTime d = Now d2 = d.ToShortDateString & " 0" & me.textbox1.text &":" & "00" Me.TextBox2.Text = d2.ToShortTimeString
Dim d As DateTime Dim d2 As DateTime d = Now d2 = d.ToShortDateString & " " & Microsoft.VisualBasic.Right("0" & Me.TextBox1.Text, 2) & ":00" Me.TextBox2.Text = d2.ToShortTimeString
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim varInt1 As Integer = CType("1", Integer) Dim varInt2 As Integer = CInt("1") Dim varInt3 As Integer = Integer.Parse("1")
Dim varInt1 As Integer = Conversions.ToInteger("1") Dim varInt2 As Integer = Conversions.ToInteger("1") Dim varInt3 As Integer = Integer.Parse("1")
Public Shared Function ToInteger(ByVal Value As String) As Integer Dim num As Integer If (Value Is Nothing) Then Return 0 End If Try Dim num2 As Long If Utils.IsHexOrOctValue(Value, (num2)) Then Return CInt(num2) End If num = CInt(Math.Round(Conversions.ParseDouble(Value))) Catch exception As FormatException Throw New InvalidCastException(Utils.GetResourceString("InvalidCast_FromStringTo", New String() { Strings.Left(Value, &H20), "Integer" }), exception) End Try Return num End Function
Friend Shared Function ParseInt32(ByVal s As String, ByVal style As NumberStyles, ByVal info As NumberFormatInfo) As Integer Dim stackBuffer As Byte* = stackalloc Byte[&H72] Dim number As New NumberBuffer(stackBuffer) Dim num As Integer = 0 Number.StringToNumber(s, style, (number), info, False) If ((style And NumberStyles.AllowHexSpecifier) <> NumberStyles.None) Then If Not Number.HexNumberToInt32((number), (num)) Then Throw New OverflowException(Environment.GetResourceString("Overflow_Int32")) End If Return num End If If Not Number.NumberToInt32((number), (num)) Then Throw New OverflowException(Environment.GetResourceString("Overflow_Int32")) End If Return num End Function
surtout plus concis
Dim stackBuffer As Byte* = stackalloc Byte[&H72]
Public Sub Test() Dim monByte as Byte maFonction(monByte) End Sub Public Sub maFonction(ByRef value As Byte) value = 11 End Sub
Dim stackBufferSize As Integer = Runtime.InteropServices.Marshal.SizeOf(GetType(Byte)) Dim stackBuffer As IntPtr = Runtime.InteropServices.Marshal.AllocHGlobal(stackBufferSize)