My First Real Program - Limpkinw.Com

Announcement

Collapse
No announcement yet.

My First Real Program

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • My First Real Program

    Well I have just started my first program that I think will be useful to myself. It logins into yahoo and checks to see if u have any mail. Only problem is I can't figure out how to login to yahoo using winsock. I tried this so far:

    Private Sub Command1_Click()
    WSock.SendData ("http://login.yahoo.com/config/login?.tries=1&.src=&.md5=&.hash=&.js=1&.last=&pro mo=&.intl=us&.bypass=&.partner=&.u=5hi8hg90cfnlq&. v=0&.challenge=OHwUAYIfQkTKZPVCMv.MvIoaqCeg&.yplus =&.emailCode=&pkg=&stepid=&.ev=&hasMsgr=1&.chkP=Y& .done=http%3A//my.yahoo.com&login="MY NAME"&passwd="MY PASSWORD"&.persistent=&.save=1&.hash=1&.md5=1")
    End Sub
    __________________________________________________
    Private Sub Command3_Click()
    End
    End Sub
    __________________________________________________
    Private Sub Form_Load()
    WSock.Close
    WSock.RemoteHost = "216.109.127.60"
    WSock.RemotePort = 80
    WSock.Connect
    End Sub
    __________________________________________________ ___




    i had no luck. Can anyone help me? Thanks.

  • #2
    because mail uses a secure HTTP type connection you will not be able to connect using winsock. Stick with INet you should be fine.
    ~ Rll~

    Comment


    • #3
      Your usage of Winsock is incorrect.

      Try the following code. It will get you to where you are trying to get to but I can't say that your parameters are correct but it will return data to your program.

      Dim Return_Data As String

      Private Sub Form_Load()
      End Sub

      Private Sub Command1_Click()
      WSock.Close

      WSock.RemoteHost = "login.yahoo.com"

      WSock.RemotePort = 80
      WSock.Connect
      End Sub

      Private Sub WSock_Connect()
      Return_Data = ""

      s3 = ".tries=1&.src=&.md5=&.hash=&.js=1&.last=&promo=&. intl=us&.bypass=&.partner=&.u=5hi8hg90cfnlq&.v=0&. challenge=OHwUAYIfQkTKZPVCMv.MvIoaqCeg&.yplus=&.em ailCode=&pkg=&stepid=&.ev=&hasMsgr=1&.chkP=Y&.done =http%3A//my.yahoo.com&login=your_id&passwd=your_password&.p ersistent=&.save=1&.hash=1&.md5=1" & vbCrLf

      s1 = "POST /config/login HTTP/1.0" & vbCrLf
      s2 = "Content-length: " & Str(Len(s3)) & vbCrLf & vbCrLf

      WSock.SendData s1 & s2 & s3

      End Sub

      Private Sub WSock_DataArrival(ByVal bytesTotal As Long)
      WSock.GetData s1, vbString
      Return_Data = Return_Data & s1
      End Sub

      Private Sub WSock_Close()
      WSock.Close
      Open "RETURN_DATA.txt" For Output As #1
      Print #1, Return_Data
      Close #1
      End Sub

      Comment


      • #4
        He will not be able to retrieve mail or do any mail functions with winsock....
        ~ Rll~

        Comment


        • #5
          Originally posted by Limpkinw
          He will not be able to retrieve mail or do any mail functions with winsock....
          You're right about that as far as what he was trying to do but I didn't post that because I thought it would actually retrieve his email from Yahoo it was just the correct way to do what he was trying to do, whatever that was.

          I write email programs all the time using Winsock. I am not saying that he will be able to get Yahoo email, per se, but in general you can use Winsock to retrieve email as long as you know SMTP.

          The rule of thumb is that you can use Winsock for any type of data transfer as long as you know the correct protocols.

          Comment


          • #6
            yahoo mail doesnt use smtp, unless u have a premium type account. thus u have to use INet
            ~ Rll~

            Comment


            • #7
              Originally posted by Limpkinw
              yahoo mail doesnt use smtp, unless u have a premium type account. thus u have to use INet
              OK, I agree with you. Like I said.....my posting was to correct his way of doing whatever he was trying to do.

              And no, you do not have to use INet (maybe he does). You can still use Winsock to access Yahoo email; so, if it isn't SMTP then you need to know what protocol you have to use, but given the correct protocol in your application it is no different than any other data transfer operation. Keep in mind, Inet is just an outter shell of Winsock to make things simple for you and me.

              Comment


              • #8
                Inet uses internet explorer as a shell. Good luck gettin winsock to connect to a secure connection (anything https) they have teams working on figuring out how to do this. I woudl like to see a project using winsock connect to https sucessfully.
                ~ Rll~

                Comment


                • #9
                  OK, let me put it in another way.........

                  If you can go to Yahoo using your browser, login to your account, go to your email and view your mail in the browser window then you can do exactly the same thing in a program using either Inet or Winsock. Which one you use doesn't matter, it all a matter of preference and Inet is by far the easiest way to do it but Winsock gives you more control of how you want to handle the communications. Anything that the browser can do, you also can do using Winsock if you know how to code Winsock.

                  Although I don't recommend Leb using Winsock unless he wants the challange he would be better off to use Inet like you mentioned.

                  Comment


                  • #10
                    why dont u try it then. I know what im talkin about anything that comes thru https is encrypted. I would like to see a winsock program that retrieves yahoo mail (other than thru smtp)
                    ~ Rll~

                    Comment


                    • #11
                      without any type of wrapper i mean of course.
                      ~ Rll~

                      Comment


                      • #12
                        Originally posted by Limpkinw
                        Inet uses internet explorer as a shell. Good luck gettin winsock to connect to a secure connection (anything https) they have teams working on figuring out how to do this. I woudl like to see a project using winsock connect to https sucessfully.
                        Yes, and Internet Explorer, or the DLL that makes up IE uses Winsock as the means to make data transfer connections. In the Windows world, Winsock is the bottom line for all Internet data transfers. If you can't do it with the Winsck.OCK then you have to use the Winsock DLL. And that is where you can connect to a secure server (https). You connect to a HTTPS server via port 443 (not 80). Once connected you need to pass back the correct handshacking protocol (not covered in the Winsock manual).

                        If you like, I will see if I can put one of my https applications (.exe only) that I had to write for the company I work for on my web site and you can d/l it and see it. I can't supply the source code as that would really get me into hot water.

                        Comment


                        • #13
                          winsock of course is the basis for data transfer in windows, however winsock.ocx as is used in vb w/out any help will not communicate effectively with a secure server.
                          I really would like to see someone prove me wrong.
                          ~ Rll~

                          Comment


                          • #14
                            I'm going to have to go on this one because I'm sure Limp knows what he is talking about.

                            ~ Lifes a Garden ~ ~ Dig It ~


                            Comment


                            • #15
                              well in a way both r correct but no way will a new programmer be writting a program to communicate with a https server. I misread the original post and thus this tangent resulted.
                              ~ Rll~

                              Comment

                              Working...
                              X