Visualizzazione dei risultati da 1 a 8 su 8

Visualizzazione discussione

  1. #1

    Vb.Net progressbar che mostra avanzamento durante la lettura.

    Ho un semplice server che gira sotto tcp,
    Il client si connette e invia al server, quello che voglio fare è, mostrare l'avanzamento dei byte ricevuti(che ricevo correttamente) lato server, il codice è in un modulo:

    Codice PHP:
    Sub Listen()

            
    ' Dim localAddress As IPAddress = IPAddress.Any
            '  
    Dim port As Integer 8080

            tcpListener
    .Start()
            
    tcpClient tcpListener.AcceptTcpClient()
            If 
    IO.File.Exists(Application.StartupPath "\DB\DBISO1.accdb"Then IO.File.Delete(Application.StartupPath "\DB\DBISO1.accdb")
            
    Using networkStream As NetworkStream tcpClient.GetStream()
                
    Using stream As Stream = New FileStream(Application.StartupPath "\DB\DBISO1.accdb"FileMode.CreateFileAccess.ReadWrite)
                    
    Dim bytes As [Byte]() = New [Byte](1023) {}
                    
    Dim length As Integer networkStream.Read(bytes0bytes.Length)
                    
    incrementa 0
                    
    While length 0
                        incrementa 
    += 1
                        cn
    ()
                        
    stream.Write(bytes0length)
                        
    length networkStream.Read(bytes0bytes.Length)
                        
    Application.DoEvents()
                    
    End While
                
    End Using
            End Using
            tcpClient
    .Close()
            
    Application.DoEvents()
            
    Dim myThread As New Thread(New ThreadStart(AddressOf Listen))
            
    myThread.IsBackground True
            myThread
    .Start()

        
    End Sub 
    Ultima modifica di TcpClient; 12-05-2023 a 10:40

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.