Visualizzazione dei risultati da 1 a 10 su 13

Hybrid View

  1. #1
    sto cercando di ragionare su questi modem, e ho inquadrato il funzionamento simile a quello delle ipcam , videocamere collegate ad un modem che poi interrogate da un software permettono lo streaming delle immagini.

    a me serve ugualmente, dove l'importante e' avere un ip di risposta, e fare un ping a questo ip.

    dal modem sim come faccio a tirare fuori l'ip? mi conviene buttarmi su un dyndns? e poi fare il ping tramite un software (ad esempio vb6?) per vb6 potrei usare questo code:

    per il ping uso:Option Explicit
    Private Declare Function GetTempFileName_ Lib "kernel32" Alias "GetTempFileNameA" (ByVal lpszPath As String, ByVal lpPrefixString As String, ByVal wUnique As Long, ByVal lpTempFileName As String) As Long
    Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
    Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
    Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
    Private Const INFINITE = &HFFFF ' Infinite timeout
    Private Const WAIT_FAILED = -1&
    Private Const SYNCHRONIZE = &H100000

    Private Function GetTempFileName() As String
    Dim buffer As String * 260
    If GetTempFileName_(Environ("temp"), "pin", 0, buffer) = 0 Then Err.Raise 51
    GetTempFileName = Left(buffer, InStr(buffer, Chr$(0)) - 1)
    End Function
    Public Function Ping(ByVal host As String) As Integer
    Dim tempFile As String
    Dim tFN As Integer
    Dim unparsedString As String
    Dim procHandle As Long
    Dim msPos As Long
    Dim delimPos As Long
    Ping = -1
    tempFile = GetTempFileName()
    procHandle = OpenProcess(SYNCHRONIZE, 0, Shell(Environ("comspec") & " /c ping -n 1 " & host & " > " & tempFile, vbHide))
    If WaitForSingleObject(procHandle, INFINITE) = WAIT_FAILED Then Err.Raise 51
    CloseHandle procHandle
    tFN = FreeFile()
    Open tempFile For Input As tFN
    Do
    Line Input #tFN, unparsedString
    msPos = InStr(unparsedString, "ms ")
    If msPos Then
    delimPos = Max(InStrRev(unparsedString, " ", msPos), InStrRev(unparsedString, "<", msPos), InStrRev(unparsedString, "=", msPos)) + 1
    On Error Resume Next
    Ping = Mid$(unparsedString, delimPos, msPos - delimPos)
    Exit Do
    End If
    Loop Until EOF(tFN)
    Close tFN
    Kill tempFile
    End Function
    Private Function Max(ParamArray values() As Variant) As Variant
    Dim counter As Long
    For counter = LBound(values) To UBound(values)
    If values(counter) > Max Then Max = values(counter)
    Next
    End Function



    e poi richiamo la funzione Ping passandole come parametro il nome dell'host. Ad esempio

    Public Sub Main()
    MsgBox Ping("151.22.22.2")
    End Sub
    ma devo capire come far uscire l'ip dal modem.

  2. #2
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,480
    Non esiste IP per la SIM ... è una scheda telefonica ...
    No MP tecnici (non rispondo nemmeno!), usa il forum.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.