Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[VB.NET] Login system , little problem [VB.NET]

Hi everyone ,

I need your help for a login system coded by Sutton2k9.

Here is the Region "Function" :

Code
#Region "Function"
    Function GetCPUID()
        Dim cpuInfo As String = String.Empty
        Dim mc As New ManagementClass("win32_processor")
        Dim moc As ManagementObjectCollection = mc.GetInstances()
        For Each mo As ManagementObject In moc
            cpuInfo = mo.Properties("processorID").Value.ToString()
        Next
        Return cpuInfo
    End Function
    Function SystemSerialNumber() As String
        Dim wmi As Object = GetObject("WinMgmts:")
        Dim serial_numbers As String = ""
        Dim mother_boards As Object = wmi.InstancesOf("Win32_BaseBoard")
        For Each board As Object In mother_boards
            serial_numbers &= ", " & board.SerialNumber
        Next board
        If serial_numbers.Length > 0 Then serial_numbers = _
            serial_numbers.Substring(2)
        Return serial_numbers
    End Function
    Function GetID()

        Dim Str1 As String = GetCPUID()
        Dim Str2 As String = SystemSerialNumber()
        Dim HWID As String = String.Empty
        Do
            If Str1 <> String.Empty Then
                HWID += Str1.Last
                Str1 = Str1.Remove(Str1.Count - 1)
            End If
            If Str2 <> String.Empty Then
                HWID += Str2.Last
                Str2 = Str2.Remove(Str2.Count - 1)
            End If
        Loop Until Str2.Count = 0 And Str2.Count = 0
        Return HWID
    End Function
#End Region

I code this error :

[img]http://img11.hostingpics.net/pics/848830Sanstitre.png[/img]

"Last is not a member of String"
"Count is not a member of String"

So , my question is : By what can i replace Last & Count ?

LastIndexOf(HWID) ?

Thanks in advance.
Those should be members of string:

[img]http://screensnapr.com/e/TY93m3.png[/img]
Str2 is solved , but str1 is not.

I can write str1 as string = "BLABLABLA"
Be cause str1 = the GetCPUID() function
try adding "As String" at the end of the function after the parameters like so

Code
Function Test() as String
End Function
Doesn't work :x

Can i use Length ?


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by CacheIsAFagOct 17, 2017 05:15 AM 20 1,184 Oct 17, 2017 05:15 AM
Last Post: CacheIsAFag
[.NET] by Debit.Oct 22, 2016 12:06 PM 6 186 Oct 22, 2016 12:06 PM
Last Post: Debit.
[.NET] by +HazeAug 28, 2015 07:43 AM 52 5,843 Aug 28, 2015 07:43 AM
Last Post: Odus