Jump to content

Recommended Posts

Posted

Hi,

anyone got some experience with the  _NetInfo_GetUploadSpeed() from the NetInfo UDF.

Been fiddeling with it for a day now. and i keep getting a return: 1 or return 2, never get my upload in kb/s.

 

This is the little bit of my script i got:

 

$s_CountryCode = "NL"
        $Upload_Speed =  _NetInfo_GetUploadSpeed()

        MsgBox(4096, "Test", $Upload_Speed)

What am I not seeing here...

Posted

37 views, no posts...am I the first with this problem?

Maybe somebody used the _NetInfo UDF before and can help me explain what I am doing wrong.

 

I keep getting a return errorcode: 2

 

$CODE = __NetInfo_GetCountryCode()
         MsgBox(4096, "", "Countrycode: " & $CODE)
        $Countrycode = $CODE
        $Upload_Speed =  _NetInfo_GetUploadSpeed()

The message box shows my country code: NL

After that i use the country code to help select the server, this asfar as I understand the UDF...

Maybe someone can give me a tip or knows what I am doing wrong/forgetting...

Posted

too little & confusing information, that's why your not getting any help

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Posted

Oh Oke, hope this helps...

what i am trying to accomplish is a hardware and network check, got all the parts done except for the upload speed check.
We are checking hardware and network connections for a cloud program.

Below you will find my code.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Inet.au3>
#include <WinAPIReg.au3>
#include <Security.au3>
#include <WinAPI.au3>
#include <NavInfo.au3>
#include <Netinfo.au3>
#include <Array.au3>
#include <smtpauth.au3>

#RequireAdmin

    If Not FileExists("C:\Temp") Then
        DirCreate("C:\Temp")
    EndIf
    If FileExists("C:\Temp\check.txt") Then
        FileDelete("C:\Temp\check.txt")
    EndIf
    $FILE       = FileOpen("C:\Temp\check.txt", 1)

    $DEBITGUI   = GUICreate("Bedrijfsnaam", 245, 108, -1, -1, $WS_POPUPWINDOW)
    $DEBITNR    = GUICtrlCreateInput("", 8, 32, 225, 21)
    GUICtrlCreateLabel("Wat is uw bedrijfsnaam?", 8, 8)
    $OK         = GUICtrlCreateButton("OK", 85, 72, 75, 25)
        GUISetState(@SW_SHOW, $DEBITGUI)
    While 1
        Switch GUIGetMsg()
            Case $OK
                $VAR = GUICtrlRead($DEBITNR)
                If $VAR <> "" Then
                    FileWrite($FILE, "Bedrijfsnaam:      " & $VAR & @CRLF)
                    FileWrite($FILE, "Datum:             " & @MDAY & "-" & @MON & "-" & @YEAR & @CRLF)
                    FileClose($FILE)
                    GUIDelete($DEBITGUI)
                    NAME()
                EndIf
                If $VAR = "" Then
                    MsgBox(4096, "Let Op!", "Bedrijfsnaam is verplicht.")
                EndIf
        EndSwitch
    WEnd

Func NAME()
    $FILE       = FileOpen("C:\Temp\check.txt", 1)
    $MEDEWERKERGUI  = GUICreate("Naam", 245, 108, -1, -1, $WS_POPUPWINDOW)
    $MEDEWERKER     = GUICtrlCreateInput("", 8, 32, 225, 21)
    GUICtrlCreateLabel("Controle is uitgevoerd door:", 8, 8)
    $OK         = GUICtrlCreateButton("OK", 85, 72, 75, 25)
        GUISetState(@SW_SHOW, $MEDEWERKERGUI)
    While 1
        Switch GUIGetMsg()
                Case $OK
                $VAR = GUICtrlRead($MEDEWERKER)
                If $VAR <> "" Then
                    FileWrite($FILE, "Uitgevoerd door:   " & $VAR & @CRLF & @CRLF)
                    FileClose($FILE)
                    GUIDelete($MEDEWERKERGUI)
                    CHECKS()
                EndIf
                If $VAR = "" Then
                    MsgBox(4096, "Let Op!", "Uw naam is verplicht.")
                EndIf
        EndSwitch
    WEnd
EndFunc

Func CHECKS()
    MsgBox(4096, "Let op!", "Test")
    $FILE = FileOpen("C:\Temp\check.txt", 1)

ProgressOn("Cloud - Check", "Gegevens verzamelen...")
    Sleep(3000)

    ProgressSet("11,11", "Uitlezen processor informatie...")
        Sleep(1500)
        $READPROC = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0", "ProcessorNameString")
        $PROC = $READPROC

        FileWrite($FILE, "Processor:         " & $PROC & @CRLF)

    ProgressSet("22,22", "Uitlezen geheugen capaciteit...")
        Sleep(1500)

        Local $aMem = MemGetStats()
            $mem = $aMem[1] /1024
            $mem1= $mem /1024
            $mem2= Round($mem1, 0)

    $READRAM = $mem2 & " GB Geheugen"
        FileWrite($FILE, "Geheugen:          " & $READRAM & @CRLF)

    ProgressSet("33,33", "Uitlezen model gegevens...")
        Sleep(1500)

        $READMODEL1 = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\Bios", "SystemManufacturer")
        $READMODEL2 = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\Bios", "BaseBoardProduct")
    $READMODEL = $READMODEL1 & " " & $READMODEL2

        FileWrite($FILE, "Model:             " & $READMODEL & @CRLF)

    ProgressSet("44,44", "Uitlezen Windows versie...")
        Sleep(1500)
        $READOS = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName")

        If @OSArch = "X86" Then
            $ARCH = "32-Bit"
        Else
            $ARCH = "64-Bit"
        EndIf
    $WINDOWS =$READOS & " " & $ARCH

        FileWrite($FILE, "Windows:           " & $WINDOWS & @CRLF)

    ProgressSet("55,55", "Uitlezen Internet Explorer versie...")
        Sleep(1500)

        Local $sVersion = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe")
        $IEVERSION = Round($sVersion, 0)
        $IE ="Internet Explorer: " & $IEVERSION
        $IEDONE     = StringTrimLeft($IE, 19)
        FileWrite($FILE, "Internet Explorer: " & $IEDONE & @CRLF)

    ProgressSet("66,66", "Uitlezen Silverlight versie...")
        Sleep(1500)
        $Silverlight_Version = _NavInfo_GetSilverlightVersion()
            If @error Then
                $SILVERLIGHT = "Silverlight: Niet aanwezig"
            EndIf
            If Not @error Then
                $SILVERLIGHT = "Silverlight: " & $Silverlight_Version
            EndIf
        $SILVERDONE = StringTrimLeft($SILVERLIGHT, 13)
        FileWrite($FILE, "Silverlight:       " & $SILVERDONE & @CRLF & @CRLF)

    ProgressSet("77,77", "Internet download snelheid testen, even geduld a.u.b.")
        Sleep(1500)

        $SPEEDCHECK = _NetInfo_GetDownloadSpeed()
            $VAR1 = _ArrayExtract($SPEEDCHECK, 1, 1)
            $VAR2 = _ArrayToString($VAR1, 1)
            $VAR3 = $VAR2 /100

        FileWrite($FILE, "Internet Snelheid: " & $VAR3 & " MBit Download" & @CRLF)

    ProgressSet("80", "Internet upload snelheid testen, even geduld a.u.b.")
        $CODE = __NetInfo_GetCountryCode()
            MsgBox(4096, "", "Countrycode: " & $CODE)
        $Countrycode = $CODE
        $Upload_Speed =  _NetInfo_GetUploadSpeed()

        FileWrite($FILE, "Internet Snelheid: " & $Upload_Speed & " Upload" & @CRLF)

    ProgressSet("90", "Opvragen IP-Adres, even geduld a.u.b.")
        Sleep(1500)
        $PublicIP = _GetIP()
        $IPADRES = $PublicIP

        FileWrite($FILE, "IP-Adres:          " & $IPADRES & @CRLF & @CRLF)

    ProgressSet("100", "Klaar.")
        Sleep(1500)
    ProgressOff()

    FileClose($FILE)

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...