Showing posts with label visual basic. Show all posts
Showing posts with label visual basic. Show all posts

Vbscript: Download files from a list of urls.

Posted: Friday, 26 April 2013

The following script can read through a list of urls [seperated by a return], and download them, for example, pretend that the following is a .txt file:

http://www.extramaster.net/LinesAndLinesOfCode.jpg
http://www.extramaster.net/GooglePlusBrand.jpg
It is then ran through the script, and "LinesAndLinesOfCode.jpg", "GooglePlusBrand.jpg" will be downloaded into the directory in which the script and the .txt file is placed in
The code is as follows:

Dynamically getting data from multidimensional JArrays

Posted: Friday, 8 March 2013

JSON.net is an incredibly horrible library to parse through arrays. JArray.parse is one way JSON data can be parsed, but it cannot be accessed in a manner which other programming languages, like javascript can.
Here's JSON code from a project I'm currently working on:

{"game": {"turn": 0, "state": [["s9", "h0", "c10", "d11", "s4", "0"], ["s7", "s1", "d2", "c3", "s10", "0"]]}}
It's valid JSON, you can check it for yourself here: http://jsonlint.com/

How to save graphics to file from a picturebox in vb.net

Posted: Wednesday, 27 February 2013

If you're like me and you've been trying to desperately convert a picture box that uses CreateGraphics() to bitmap or any other image in VB.net, you'll find that you can't do it. The object that that creates can only seemingly be accessed by .GetHdc(), however using Bitmap.FromHbitmap(objcanvas.GetHdc()) results in an error..