Results 1 to 5 of 5

Thread: Using Javascript SDK in my VB.NET Console application

  1. #1
    NicolaiL is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    May 2013
    Posts
    3
    Reputation
    0

    Using Javascript SDK in my VB.NET Console application

    I'd like to be able to incorporate a 3rd party JS SDK in my console appliacation, but I can't figure out how to set up the references to the SDK (or perhaps this is not possible?).

    So far no luck googling for answers, so posting here in the hope that someone can point me in the right direction?

  2. #2
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    13,778
    Reputation
    1703
    You can only add a reference to your project for a .NET assembly or a COM library. If your SDK doesn't include one of those then there's no reference to be added. If you were to actually explain what you have in more detail than "3rd party JS SDK" then we may be able to be more specific.

  3. #3
    NicolaiL is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    May 2013
    Posts
    3
    Reputation
    0
    Thanks for responding. Perhaps the term SDK is a little misleading, but that is what (Neato) the supplier was using. Essentially they have a bunch of ready to use JS that would allow me to log into their service (OAuth2), and control the robovac.

    I'm aiming to write a third-party integration to homeautomation, as a console application in vb.net, and rather than re-invent the wheel, I would like to use the JS that Neato have provided.

    As an example they state:
    Setup

    In order to use the Neato SDK JS simply import the jQuery and hmac-sha256 dependencies and the neato-x.y.z.min.js file:
    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/hmac-sha256.js"></script>
    <script src="../lib/neato-0.7.0.min.js"></script>

    ...

    2. Start the authentication flow


    To start the authentication flow simply invoke the login() method on the user object passing the above data:
    var user = new Neato.User();
    user.login({
    clientId: "your_app_client_id",
    scopes: "control_robots+email",
    redirectUrl: "your_redirect_uri"
    });

    etc. etc.

    So essentially all the relevant snippets are provided if only I could find a way to call them from my vb.net (console) application.

  4. #4
    NicolaiL is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    May 2013
    Posts
    3
    Reputation
    0
    Bump. Anyone able to give me a leg up in how to achieve this?

  5. #5
    JuggaloBrotha's Avatar
    JuggaloBrotha is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Jun 2004
    Location
    Lansing, MI; USA
    Posts
    4,464
    Reputation
    1015
    Why would anyone ever want to use JS in a console app, console apps have nothing to do with internet things inherently and have nothing to do with web browsers either.
    Since this script you're using has the ability to log into something & since all JS is plain text, why don't you go through their libraries and see how the login part works, then replicate that in .Net code?
    Currently using: VS 2010 Ultimate on Win7 Ultimate x64.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •