Jump to content

Upload speed check

Recommended Posts



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

Share this post

Link to post
Share on other sites

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

Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

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>


    If Not FileExists("C:\Temp") Then
    If FileExists("C:\Temp\check.txt") Then
    $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)
                If $VAR = "" Then
                    MsgBox(4096, "Let Op!", "Bedrijfsnaam is verplicht.")

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)
    While 1
        Switch GUIGetMsg()
                Case $OK
                $VAR = GUICtrlRead($MEDEWERKER)
                If $VAR <> "" Then
                    FileWrite($FILE, "Uitgevoerd door:   " & $VAR & @CRLF & @CRLF)
                If $VAR = "" Then
                    MsgBox(4096, "Let Op!", "Uw naam is verplicht.")

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

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

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

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

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

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

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

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

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

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

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

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

        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...")
        $Silverlight_Version = _NavInfo_GetSilverlightVersion()
            If @error Then
                $SILVERLIGHT = "Silverlight: Niet aanwezig"
            If Not @error Then
                $SILVERLIGHT = "Silverlight: " & $Silverlight_Version
        $SILVERDONE = StringTrimLeft($SILVERLIGHT, 13)
        FileWrite($FILE, "Silverlight:       " & $SILVERDONE & @CRLF & @CRLF)

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

        $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.")
        $PublicIP = _GetIP()
        $IPADRES = $PublicIP

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

    ProgressSet("100", "Klaar.")



Share this post

Link to post
Share on other sites

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

  • Similar Content

    • nacerbaaziz
      By nacerbaaziz
      Detect if the focus item is a button or check box
      Hello everyone.
      My dears I have a problem
      When I try to use
      ControlGetFocus function
      it  doesn't recognize the check  boxes.
      The result is that the selector is a button
      Although the specified is a check box
      but I want a way to identify the check boxes.
      Because I want to make a tool that helps screen readers users
      I hope you have the solution.
      Thank you in advance.
    • Triblade
      By Triblade
      Hi all,
      I was pondering over a question with regards to the speeds of reading something and did not see this kind of question in a forum search.
      The question: What is (technically) faster? Multiple reads from the same 3d array cell, or only once make a 'temp' variable from that cell and read the value from this? I don't know if either has any real impact at all anyway, but just wanted to ask anyway. :-)
      There may be a difference if the value holds an integer or a string (or something else) but in my case, is a simple integer.
      To hopefully clarify with a small bit of code:
      $process = $start - 15 If $xy[$process][3] <> "x" Then If _ArraySearch($open, $process, 1, $open[0][0], 0, 0, 1, 1) <> -1 Then UpdateOpen($xy[$process][5], $closed[0][0]) ElseIf $start > 0 And _ArraySearch($closed, $process, 1, $closed[0][0], 0, 0, 1, 0) = -1 Then Add_open($start, $closed[0][0], $counter, $process) EndIf EndIf You can read from this, that the array $closed[0][0] is being read 3 times. And this goes on further in the code I did not show.
      My question boils down to this, should I make a 'temp' variable to hold that $closed[0][0] value until the function is done?
      It may not have a real impact on my small script, but I really am interested in the answer at least.
    • ruslanas402
      By ruslanas402
      Greeting, so I've been trying to come up with solution, but no luck. Despite I tried to automate upload function, I released that it freezes after "Choose File to Upload" window appears..
      #include <IE.au3> ;#include <_Dbug.au3> Global $oIE = _IECreate("http://tinypic.com/", 1) Global $upload2 = _IEGetObjById($oIE, "the_file") _IEAction($upload2, "click") ;Sleep(1000) $hWnd = WinGetHandle("Choose File to Upload") MsgBox(0, "", $hWnd) Have anybody faced this situation?
      btw: srry for the advertise Besides it's no matter which site I'm trying to do this it's all the same.
    • Jdr
      By Jdr
      I'm trying to check for the existance of a file, on logon the file is there, then gets deleted and after a while recreated. I'm using this code:
      Sleep(100) If not FileExists($sFile) Then Sleep(150) If FileExists($sFile) Then GUICtrlSendToDummy($iDummy) What happens is this: 
      User logs on, the file is present, or at least it usually is After about 10 seconds the file gets deleted Then after about 50 seconds the file gets created again, this is when I need the check, because now the process is finished. The above code is part of a pretty long do....until false loop running an animation.
      The problem is that sometimes this code fails. Without the sleep statements it didn't work at all so I think this is a timing issue. Pretty primitive code I admit, there must be a better way...
    • RyukShini
      By RyukShini
      Hello everyone!

      I am trying to make a script that uploads files for me in wordpress(All I need to do is to manually choose which files to upload)
      Here is my script so far:
      #include <FileConstants.au3> #include <MsgBoxConstants.au3> Upload() Func Upload() $sPD = "log=username&pwd=mypassword&wp-submit=Log+ind&redirect_to=http%3A%2F%2Fmyurl.com%2Fwp-admin%2F&testcookie=1" oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", "http://myurl.com/wp-login.php " & $sUSR, False) ; Post url $oHTTP.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") $oHTTP.SetRequestHeader("Accept-Language", "en-US,en;q=0.5") $oHTTP.SetRequestHeader("User-Agent", "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.52 YaBrowser/15.12.2490.3614 (beta) Yowser/2.5 Safari/537.36") $oHTTP.SetRequestHeader("Referer", "http://myurl.com/wp-login.php?redirect_to=http%3A%2F%2Fmyurl.com%2Fwp-admin%2F&reauth=1") $oHTTP.SetRequestHeader("Cookie", "wordpress_test_cookie=WP+Cookie+check") $oHTTP.SetRequestHeader("Connection", "keep-alive") $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; Header data > $oHTTP.Send($sPD) $oHTTP.Open("GET", "http://myurl.com/wp-admin/media-new.php", False) ; Post url $oHTTP.SetRequestHeader("Host", "myurl.com") $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0") $oHTTP.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") $oHTTP.SetRequestHeader("Accept-Language", "en-US,en;q=0.5") $oHTTP.SetRequestHeader("Referer", "http://myurl.com/wp-admin/") $oHTTP.Send() Endfunc The upload button = "Choose Files"
      Example code from:
      #include <FileConstants.au3> #include <MsgBoxConstants.au3> Example() Func Example() ; Create a constant variable in Local scope of the message to display in FileOpenDialog. Local Const $sMessage = "Select a single file of any type." ; Display an open dialog to select a file. Local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\", "All (*.*)", $FD_FILEMUSTEXIST) If @error Then ; Display the error message. MsgBox($MB_SYSTEMMODAL, "", "No file was selected.") ; Change the working directory (@WorkingDir) back to the location of the script directory as FileOpenDialog sets it to the last accessed folder. FileChangeDir(@ScriptDir) Else ; Change the working directory (@WorkingDir) back to the location of the script directory as FileOpenDialog sets it to the last accessed folder. FileChangeDir(@ScriptDir) ; Replace instances of "|" with @CRLF in the string returned by FileOpenDialog. $sFileOpenDialog = StringReplace($sFileOpenDialog, "|", @CRLF) ; Display the selected file. MsgBox($MB_SYSTEMMODAL, "", "You chose the following file:" & @CRLF & $sFileOpenDialog) EndIf EndFunc ;==>Example The HTML:
      <p class="drag-drop-buttons"><input style="position: relative; z-index: 1;" id="plupload-browse-button" value="Choose Files" class="button" type="button"></p> Some header info in the HTTP request:
      POST http://myurl.com/wp-admin/async-upload.php HTTP/1.1 Host: myurl.com User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Referer: http://myurl.com/wp-admin/media-new.php Content-Length: 4555551 Content-Type: multipart/form-data; boundary=---------------------------12345678910 Cookie: LONG COOKIE HERE! DNT: 1 Connection: keep-alive -----------------------------102062144610664 Content-Disposition: form-data; name="name" hdfhfg.jpg -----------------------------102062144610664 Content-Disposition: form-data; name="post_id" 0 -----------------------------102062144610664 Content-Disposition: form-data; name="_wpnonce" 123456 -----------------------------102062144610664 Content-Disposition: form-data; name="type" -----------------------------102062144610664 Content-Disposition: form-data; name="tab" -----------------------------102062144610664 Content-Disposition: form-data; name="short" 1 -----------------------------102062144610664 Content-Disposition: form-data; name="async-upload"; filename="hdfhfg.jpg" Content-Type: image/jpeg This wouldn't be much of a problem if I just had some simple post data, but this makes my head spin....
      Thanks in advance Masters!
      (I could probably easily do this with IE, but I'd rather not use IE, I am not a big fan of it)