Results 1 to 4 of 4
Thread: VB .NET String
Hybrid View
-
3rd May 2007 23:19 #1
VB .NET String
, 22:35 , 22 35?
Crashing is NOT normal. It is accepted as normal because of Windows.
Ah the Geforce 440 MX...all the power of the Geforce 2MX, without nearly a damn being changed...
-
4th May 2007 02:26 #2
C# e :
//Common
string time = "22:35";
//Case 1.
string[] splitted = time.Split(new char[] {':'});
string hoursString = splitted[0];
string minutesString = splitted[1];
//Case 2.
string hoursString = time.Substring(0, 2);
string minutesString = time.Substring(3, 2);
//Common
int hours = int.Parse(hoursString);
int minutes = int.Parse(minutesString);
. , .NET, VB.NET. , . MSDN-a . .
-
4th May 2007 08:24 #3
#. . http://converter.telerik.com/
:
Code:'Common Dim time As String = "22:35" 'Case 1. Dim splitted As String() = time.Split(New Char() {":"C}) Dim hoursString As String = splitted(0) Dim minutesString As String = splitted(1) 'Case 2. 'Dim hoursString As String = time.Substring(0, 2) 'Dim minutesString As String = time.Substring(3, 2) 'Common Dim hours As Integer = Integer.Parse(hoursString) Dim minutes As Integer = Integer.Parse(minutesString)
.Split() , - 1:23, 11:34...
99 little bugs in the code, 99 little bugs...
Knock one down, and test it again, 100 little bugs in the cod...
-
4th May 2007 10:17 #4
, , !
( )
. ?
PCDim ledm(5) As Integer
Dim ledh(3) As Integer
Dim ledchosem As Integer
Dim ledchoseh As Integer
Dim temptimem As Integer
Dim temptimeh As Integer
Dim time As String
time = Now.ToShortTimeString
Dim splitted As String() = time.Split(New Char() {":"c})
Dim hoursString As String = splitted(0)
Dim minutesString As String = splitted(1)
Dim hours As Integer = Integer.Parse(hoursString)
Dim minutes As Integer = Integer.Parse(minutesString)
Dim labels() As Label = {Label0, Label1, Label2, Label3, Label4, Label5}
Dim HLabel() As Label = {HLabel0, HLabel1, Hlabel2, HLabel3}
Label6.Text = Now.ToShortTimeString
ledm(0) = 32
ledm(1) = 16
ledm(2) = 8
ledm(3) = 4
ledm(4) = 2
ledm(5) = 1
ledchosem = 0
temptimem = minutes
'loop
For ledchosem = 0 To 5
If ledm(ledchosem) <= temptimem Then
temptimem = temptimem - ledm(ledchosem)
labels(ledchosem).BackColor = Color.Lime
Else
labels(ledchosem).BackColor = Color.Gray
End If
Next
ledh(0) = 8
ledh(1) = 4
ledh(2) = 2
ledh(3) = 1
ledchoseh = 0
temptimeh = hours
', 12 12
If temptimeh > 12 Then
temptimeh = temptimeh - 12
End If
'loop
For ledchoseh = 0 To 3
If ledh(ledchoseh) <= temptimeh Then
temptimeh = temptimeh - ledh(ledchoseh)
HLabel(ledchoseh).BackColor = Color.Lime
Else
HLabel(ledchoseh).BackColor = Color.Gray
End If
Next
End Sub
* .net
COM Shift Register 10 .
: - 13 ,
2:Last edited by wolfshark; 4th May 2007 at 10:55.
Crashing is NOT normal. It is accepted as normal because of Windows.
Ah the Geforce 440 MX...all the power of the Geforce 2MX, without nearly a damn being changed...




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in