1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Javascript in C#

Discussion in 'C, C++, C#' started by pavan_buzz, Sep 16, 2009.

  1. pavan_buzz

    pavan_buzz Junior Member

    Joined:
    Jul 25, 2009
    Messages:
    169
    Likes Received:
    115
    Occupation:
    Freelancer
    Location:
    Internet
    I am doing a bot, which requires Javascript to be executed on C#.Not ASP.NET . I need to use it in normal windows form of c#. Please help me out... i need a solution to execute Javascripts... Hoping for BHW members to help me out... :)
     
  2. dparker

    dparker Newbie

    Joined:
    Feb 7, 2009
    Messages:
    28
    Likes Received:
    100
    Occupation:
    Software enginner
    Location:
    Canada
    Use the browser component control. It uses IE as a rendering engine and can execute javascript.
     
  3. pyronaut

    pyronaut Executive VIP

    Joined:
    Dec 9, 2008
    Messages:
    1,229
    Likes Received:
    1,422
    Correct, you can just use browser control. Why do you need to execute javascript? Unless the javascript is on the page you can use the mshtml component to do "javascript type things"
     
  4. pavan_buzz

    pavan_buzz Junior Member

    Joined:
    Jul 25, 2009
    Messages:
    169
    Likes Received:
    115
    Occupation:
    Freelancer
    Location:
    Internet
    hey guys.. i see that many sites use javascript to set cookies. But webbrowser component is pretty slow.. So in order to make things spice up.. i do this.. can i write a script on the fly and execute it with webbrowser component???
     
  5. Tcm9669

    Tcm9669 Regular Member

    Joined:
    Dec 30, 2007
    Messages:
    369
    Likes Received:
    26
    All you need to do is make a web browser component and then make it

    Code:
    webBrowser1.Navigate("javascript:JAVA SCRIPT CODE HERE");
    or something like that should work.