fill html forms with c sharp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gabriel10
    New Member
    • Jan 2010
    • 3

    fill html forms with c sharp

    Hello everyone,

    I'm having trouble with some code, and i hope someone can enlighten me somehow. I'm trying to create a windows application that can fill out some html forms on some website. I googled about this topic all day long (its been almost 5 hours since i started), i found some partial info, but nothing that i could fully understand. I must say i'm fairly new to C#, but i think i can manage.
    Anyway, the only thing i found and was working was this:
    http://www.codeproject .com/KB/cs/mshtml_automati on.aspx
    It simply runs a windows application, that has a WebBrowser component, goes to google, fills in some text and submits to i'm feeling lucky button. This is exactly what i want, only i want to make a more complex one.
    The problem here is that the code is written in an older version of C#, and i don't understand too much. I tried recreating the code using C# 2008 Express Edition, while inspiring from this project, with no luck.
    If some one could explain in detail how this code works and how to implement it in C# 2008, i would really appreciate it. I think many other people are looking into this.
    Also, if some one has another idea, i will kindly ask him/her to share it.

    Thank you in advance for your time, i hope i will be enlightened :).
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    The problem here is that the code is written in an older version of C#, and i don't understand too much. I tried recreating the code using C# 2008 Express Edition, while inspiring from this project, with no luck.
    While a newer release of C# might have *more* features, I don't think there is anything major stopping older code from running in a newer environment.

    May I suggest you first make a project that works exactly as your sample code... Get that up to date and functional... Then copy that project so you ahve a backup... Then start modifying in a way that is inspired from the (working) original.

    Comment

    • gabriel10
      New Member
      • Jan 2010
      • 3

      #3
      Hello and thank you for your reply.
      The code runs fine C# 2008 after it was converted. I tried to do the exact same thing you said, try to recreate it being inspired from the working project with no success. The code is "compressed " into 1 file, meaning that the form.cs code and program.cs code are in one place and it's pretty messy. I don't understand too much of it as it uses some external references too.
      You can take a peak here: http://www.codeproject.com/KB/cs/mshtml_automation.aspx

      I would like some guidance so i can fully understand the code so i can reuse it to make more complex things.
      New ideas are welcome as well.

      Thank you

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        I'm afraid I don't really have the free time to completely disassemble that project, study it, and then explain it - I just have too much on my plate for work at the moment.

        Comment

        • gabriel10
          New Member
          • Jan 2010
          • 3

          #5
          No worries, maybe i'll figure it out on my own, if so, i will post the solution here, if not, i will kindly ask you for a little guidance when you have the time. Or maybe someone else will see this post.
          Thank you.

          Comment

          Working...