Visualizzazione dei risultati da 1 a 5 su 5
  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2000
    Messaggi
    1,309

    [vb,net] Creare un software per accesso posta

    Salve a tutti e buone feste, ho diverse caselle e mail con libero ed email.com, vorrei creare un software che cliccando su diversi button mi apra la pagina della posta che ho cliccato, mi spiego meglio il software dovrebbe avere un button per ogni mia casella di posta, quando clicco sul primo button mi apre la pagina dove si fa il log in della posta di libero, mi scrive la user e la password e mi fa ok, e poi mi apre la pagina dove posso leggere la posta, questo ache per le altre mail, tutto ciò per non dover mettere e ricordare la user e la pass di diversi account di posta. La mia idea sarebbe questa ma non so se è realizzabile, voglio leggere il codice html della pagina di log in di libero, vedere come si chiamano i campi use e pass e a quale pagina vengono inviati, poi con vb.net vorrei chiamare la pagina che fa il controllo della log in e passargli la user e la pass e poi aprire la pagina di explorer con la mia posta.

    Si può fare?? come si fa??

    Grazie
    Ciao By Peter_Pan...

  2. #2
    Utente di HTML.it
    Registrato dal
    Jun 2000
    Messaggi
    1,309
    Bene sono riuscito a fare una pagina html che premendo un solo tasto, mi fa il login in libero automaticamente, questo l'ho fatto copiando i campi user e pass di libero e vedendo quale era il link del submit della pagina, ora vorrei fare la stessa cosa in vb.net, come posso fare?
    Ciao By Peter_Pan...

  3. #3
    Utente di HTML.it
    Registrato dal
    Jun 2000
    Messaggi
    1,309
    sto facendo delle prove ma scarsi risultati, mi date una mano??
    Come si fa a chiamare una pagina html e passargli dei dati con method post?
    Sto vedendo che devo usare il name space Sisytem.net e i metodi HttpWebRequest ma non so come vi posto un po di codice che ho trovato sul sito msdn ma non ho ben capito a che serve
    codice:
    ' A new 'HttpWebRequest' object is created.
            Dim myHttpWebRequest As HttpWebRequest = WebRequest.Create("www.html.it")
    
            myHttpWebRequest.SendChunked = True
            ' 'TransferEncoding' property is set to 'gzip'.
    
            myHttpWebRequest.TransferEncoding = "gzip"
            Console.WriteLine(ControlChars.Cr + "Please Enter the data to be posted to the (http://" + ChrW(60) + "machine name" + ChrW(62) + "/CodeSnippetTest.asp) uri:")
    
            Dim inputData As String = Console.ReadLine()
            Dim postData As String = "testdata" + ChrW(61) + inputData
            ' 'Method' property of 'HttpWebRequest' class is set to POST.
            myHttpWebRequest.Method = "POST"
    
            Dim encodedData As New ASCIIEncoding
            Dim byteArray As Byte() = encodedData.GetBytes(postData)
            ' 'ContentType' property of the 'HttpWebRequest' class is set to "application/x-www-form-urlencoded".
            
    	myHttpWebRequest.ContentType = "application/x-www-form-urlencoded"
            ' 'ContentLength' property is set to Length of the data to be posted.
            
    	myHttpWebRequest.ContentLength = byteArray.Length
            
    	Dim newStream As Stream = myHttpWebRequest.GetRequestStream()
            newStream.Write(byteArray, 0, byteArray.Length)
            newStream.Close()
            Console.WriteLine(ControlChars.Cr + "Data has been posted to the Uri" + ControlChars.Cr + ControlChars.Cr + "Please wait for the response..........")
            ' The response object of 'HttpWebRequest' is assigned to a 'HttpWebResponse' variable.
            Dim myHttpWebResponse As HttpWebResponse = CType(myHttpWebRequest.GetResponse(), HttpWebResponse)
            ' Displaying the contents of the page to the console
            Dim streamResponse As Stream = myHttpWebResponse.GetResponseStream()
            Dim streamRead As New StreamReader(streamResponse)
            Dim readBuff(256) As [Char]
            Dim count As Integer = streamRead.Read(readBuff, 0, 256)
            Console.WriteLine(ControlChars.Cr + "The contents of the HTML page are :  ")
            While count > 0
                Dim outputData As New [String](readBuff, 0, count)
                Console.WriteLine(outputData)
                count = streamRead.Read(readBuff, 0, 256)
            End While
            ' Release the response object resources.  
            streamRead.Close()
            streamResponse.Close()
            myHttpWebResponse.Close()
    Ciao By Peter_Pan...

  4. #4
    Utente di HTML.it
    Registrato dal
    Jun 2000
    Messaggi
    1,309
    up nessuno mi può aiutare
    Ciao By Peter_Pan...

  5. #5
    Utente di HTML.it
    Registrato dal
    Jul 2001
    Messaggi
    798
    c'è un altro thread in merito:
    http://forum.html.it/forum/showthrea...hreadid=921359

    il content-type solo è diverso, nel tuo caso:
    application/x-www-form-urlencoded
    Ans.

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.