Results 1 to 4 of 4

Thread: VB .NET String

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    rootless wolfshark's Avatar
    Join Date: Dec:2005
    Location:
    Posts: 5,768

    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...

  2. #2
    no one ceco_todorov's Avatar
    Join Date: Jul:2006
    Location: Sofia
    Posts: 63
    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 . .

  3. #3
    Whimmy Wham Wham Wozzle! lini's Avatar
    Join Date: Dec:2001
    Location: Wormulon
    Posts: 2,446
    #. . 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...

  4. #4
    rootless wolfshark's Avatar
    Join Date: Dec:2005
    Location:
    Posts: 5,768
    , , !
    ( )
    . ?
    Dim 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
    PC
    * .net
    COM Shift Register 10 .

    : - 13 ,
    2:
    Attached Files
    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |