Need help figuring this out (VB and Javascript)

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts Page 1 of 1
Contributors
User avatar
dj1437
VIP - Donator
VIP - Donator
Posts: 504
Joined: Tue Dec 21, 2010 2:02 am

Okay, so, huge request because I am in major trouble. Heres the story. Theres a website called perk.com. you earn points, get gift cards. A nice guy on the perktv subreddit built a tracker to see how many points per hour you get etc. There became a huge hoopla over security as it used tokens that was proven to be able to be used to hijack accounts (people thought tokens were being uploaded to be hijacked). The nice guy released GitHub source code, I asked for approval to make a desktop application to git rid of the security concern of tokens being hijacked. Basically its a webapp/javascript applet, and I'm making a wrapper for it in visual basic. I finished the UI for the visual basic application, and I have a webbrowser control on it, but when it loads the index.html from the project, I get a black screen. I asked the guy why this is, and he says it needs to be on a web server. I asked, and it seems like if it were running over a local server (i.e. localhost) it would work just fine. My problem is that I have no clue on how to create a local webserver using visual basic. And that's where I need help. So I guess this isn't a visual basic question, even though its being wrapped together using it.

So let me sum this up:
Visual basic application with webbrowser control : complete
Html page powered by javascript : obtained via GitHub and ready to be implemented
Page wont display unless on web server, objective is to run it on localhost
I have no clue how to do that

SOO, with that said, I know its a really big request, but if anybody could help that would be amazing. the GitHub url is here if anybody wants to take a look https://github.com/chrisxclash/perk-watch
Also I included the Visual Studio source code if anyone wants to take a look.
You do not have the required permissions to view the files attached to this post.
This is a signature.
User avatar
visualtech
VIP - Donator
VIP - Donator
Posts: 265
Joined: Sat Nov 19, 2011 2:19 pm

dj1437 wrote:
Okay, so, huge request because I am in major trouble. Heres the story. Theres a website called perk.com. you earn points, get gift cards. A nice guy on the perktv subreddit built a tracker to see how many points per hour you get etc. There became a huge hoopla over security as it used tokens that was proven to be able to be used to hijack accounts (people thought tokens were being uploaded to be hijacked). The nice guy released GitHub source code, I asked for approval to make a desktop application to git rid of the security concern of tokens being hijacked. Basically its a webapp/javascript applet, and I'm making a wrapper for it in visual basic. I finished the UI for the visual basic application, and I have a webbrowser control on it, but when it loads the index.html from the project, I get a black screen. I asked the guy why this is, and he says it needs to be on a web server. I asked, and it seems like if it were running over a local server (i.e. localhost) it would work just fine. My problem is that I have no clue on how to create a local webserver using visual basic. And that's where I need help. So I guess this isn't a visual basic question, even though its being wrapped together using it.

So let me sum this up:
Visual basic application with webbrowser control : complete
Html page powered by javascript : obtained via GitHub and ready to be implemented
Page wont display unless on web server, objective is to run it on localhost
I have no clue how to do that

SOO, with that said, I know its a really big request, but if anybody could help that would be amazing. the GitHub url is here if anybody wants to take a look https://github.com/chrisxclash/perk-watch
Also I included the Visual Studio source code if anyone wants to take a look.
So, if I get it correctly, you want to i) implement a web-server in Visual Basic; ii) the localpath of that web-server should point to the directory containing your JavaScript source? If that's your case, there are many solutions:

1) If you just need to run a local web-server and it's not an in-tier (Level I/II) application coherent with the Visual Basic counter part, you can use Node.JS (ask me for help if you want to set it up)

2) If your application is tied up, i.e. you need to have that web-server inside your applicaton, you can use a TCP/IP based implementation; dtails on it can be found here: http://www.codeproject.com/Articles/150 ... er-using-C

I wouldn't recommend that as it will slow down your application. A work around can be using threads, but for max-performance, you'll use threading in the server as well, so it'll turn into a spaghetti of threads, often leading to memory-leaks.

3) You need a web-server but it's not tied to the application but is freely available everywhere: deploy a Google Cloud Compute instance (~$8/month) or use Heroku (Free, but the engine needs to rest for 6 hours a day (i.e. 24 hours)) I can help you set it up, in case you want.

At last, if I didn't comprehend your problem correctly, leave me a message, I'll follow up! :) Cheers!
Image
Filip
Coding Guru
Coding Guru
Posts: 833
Joined: Wed Jan 05, 2011 3:59 pm

I'd say that problem is possibly usage of ajax requests on app.. Ajax requests tend to not work in local environment
CodenStuff wrote:
Nope, it's just your sick and dirty mind. You sick twisted warped little pervo :D
User avatar
visualtech
VIP - Donator
VIP - Donator
Posts: 265
Joined: Sat Nov 19, 2011 2:19 pm

Hey! Filip, the problem was with the IE7 rendering component. :)
Image
4 posts Page 1 of 1
Return to “Coding Help & Support”