Visual Studio Debug Primer Tutorial

Visual Studio Debug Primer Tutorial

Visual Studio Debug Primer Tutorial

In today’s tutorial we show you Visual Studio debugging and use the program of VB.Net More on Web Browser Favourites Tutorial as shown below.

Visual Studio is absolutely brilliant for debugging. This might sound silly, but think the way you gravitate towards Visual Studio debugging (for me anyway) are the colours used and the look of it. Things become available at the right time on the menus and screen windows can be moved around and docked. Breakpoints are so easy to toggle (even easier than shown on the tutorial, where we wanted to show you a menu … but in reality you can just left click in the left margin next to a line of code). It is really really good.

Lots of analyst/programmers might, for good reason, say that if you need to debug, the code is bad, but, from my point of view it can be really good when there are input/output issues involved with events behind that usage of input/output … and for mine … that is a lot of scenarios. Am not sure it is that great when there are threads involved, but am sure there are people out there who work it out (to be useful) even there (have debugged a Background_Worker scenario, come to think of it). Overall all, though, with good planning, and apt data structures, why should you need to debug, and this is the point of analyst/programmers who do not think you should ever have to debug.

Anyway, have a look at Visual Studio go (under the hood, so to speak) as far as debugging goes, and hope you enjoy the tutorial.


Previous VB.Net More on Web Browser Favourites Tutorial is shown below.

VB.Net More on Web Browser Favourites Tutorial (try twirling round bottom of image for a synopsis ... 'do the twirl now')

VB.Net More on Web Browser Favourites Tutorial (try twirling round bottom of image for a synopsis ... 'do the twirl now')

Do you remember the tutorial VB.Net Web Browser Favourites Primer Tutorial? Well, with this tutorial we add an onion layer on top. This is the way I really like to program. Get the essence right first, then build onion layers on top, and have supervisors of supervisors of supervisors … for Onion a then Onion 1-a then Onion A-1-a … then Onion of the Fourth Dimension! So that new onion layer of ours is to have the Dropdown selection do something before it goes off to that Dropdown My Favourite URL selection. Guess what might be a good thing to use for such an in between (interventionist) procedure. We have HTML, so what can be like an onion layer on top of the client-facing HTML/Javascript? Something server-side? What about PHP? So we’ll get the VB.Net to write its own PHP. Why not? It knows where to write it, because, as with the previous tutorial, it assumes you have EasyPHP going ( big assumption, but think you can handle the changes if you have another local webserver arrangement … hint: look for code with http://127.0.0.1 ).

This PHP does a line and character count of the destination URL and does a (bit of an awkward HTML) word count as well, showing this to you in a Javascript alert() box before proceeding to the actual website using window.location=’?’ methods.

Download this VB.Net code as required and rename to Module1.vb.


Previous tutorial VB.Net Web Browser Favourites Primer Tutorial

VB.Net Web Browser Favourites Primer Tutorial

VB.Net Web Browser Favourites Primer Tutorial

VB.Net using Visual Studio is another great language to learn. If you like VB.Net you may eventually like C#, and vice versa. It has sophisticated data structures, can be Object Oriented and makes great Windows desktop applications or can be the code behind an ASP.Net website or web application. Here we use it in a Visual Studio Console Application project, used because what we are using VB.Net for here does not require a Windows Form.

To understand why we use VB.Net to do this job of displaying the Web Favourites in a dropdown, we must understand how Javascript and other client web languages can not access the underlying operating system of the client computer (laptop, in our case). Why should that matter? Well, Web Favourites are controlled by the Web Browser, which is a desktop program that has access to local file systems and the operating system of the client. This Web Browser (and for this .Net application we are defaulting to Internet Explorer) saves its Web Favourites to the file system of the client and controllable by the client operating system, but therefore, not accessible to Javascript or other web browsing client agents. So what can we do, to achieve the aims of this tutorial? Well, what I’ve decided to do, is to assume you are using an EasyPHP local web server, and to write a Visual Studio VB.Net desktop (console) application that can reach, access and read those Web Favourites files and write to EasyPHP’s http://127.0.0.1/ (the mapping of which can be gleaned by looking at the client’s PATH environment variable and was C:Progra~1EasyPHP-12.1www in my case), to a file called MyFavourites.html and finish off by executing that MyFavourites.html with Internet Explorer. You’ll be getting the hint that this is a Windows tutorial, but as soon as I said VB.Net that had to be the case!

You could well ask why do this, when the browser can do it, but you may have forgotten what a programmer does, and is interested in. A programmer arranges to be able to make things happen in a controllable way, so with what this program does, it could be extended in functionality to do a lot of other things now that the data is web-accessible for both client and server, from using PHP or ASP.Net server-side programs to write to files or a database, or to glean information from the Web Favourites list destination websites (which we may do in another tutorial of the future … VB.Net More on Web Browser Favourites Tutorial). Of course there would be other ways to achieve this same result.

So let’s see this tutorial.

Download this VB.Net code as required and rename to Module1.vb.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Software, Tutorials, Visual Studio and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *