Vb 6.0/vb .NET & Intranet/internet Application Development

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 24, 2009, 02:01 AM
431593 members and 298611 Topics
Latest Member: adimoffion
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Vb 6.0/vb .NET & Intranet/internet Application Development
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Vb 6.0/vb .NET & Intranet/internet Application Development  (Read 1106 views)
*dhtml
Vb 6.0/vb .NET & Intranet/internet Application Development
« on: January 06, 2009, 09:54 PM »

Here, we are going to be talking about how to use visual basic 6.0/vb 2005 [.NET] to build applications that run on intranet. However the contents are going to web pages.
The objectives of this thread are listed as follows:
1. How to develop a portable web browser with visual basic 6.0/vb 2005 [.NET]
2. How to control local web servers such as apache [i left out IIS intentionally - ask me why later] based servers like wamp with vb 6.0/vb 2005 [.NET]
3. How to detect if a server is running or not with vb 6.0/vb 2005 [.NET]
4. How to serve load your php/mysql documents inside your vb application
5. How to synchronize the events in a web page with that in vb applications. For instance if your vb application is displaying a web page and you click on a   
    close button inside the web page to actually close the vb app.
6. How to bundle everything into MSI packages ready for distribution.

Maybe i am out of date - but i made some few softwares in this area some years back - i did that before .NET came out.

Before i continue this thread, guys i will like to know what you think - please signify your interesting by posting something like "Yo!"
Failure to get at least 4 responses means i will abandon this thread - or maybe people assume DHTML does not do anything outside web dev.
blackweaver (m)
Re: Vb 6.0 & Intranet/internet Application Development
« #1 on: January 06, 2009, 10:27 PM »

Go on am all ears (or is it eyes?)
Kobojunkie
Re: Vb 6.0 & Intranet/internet Application Development
« #2 on: January 06, 2009, 10:48 PM »

Yep,  seems you are way out of date. Do you mind using Visual Basic 9.0 instead of 6.0 ? I mean I am not sure how many companies out there still use VB6 but 9.0 is here and more and more projects have consultants updating 6.0's to 9.0 now. But do continue.

*dhtml
Re: Vb 6.0 & Intranet/internet Application Development
« #3 on: January 07, 2009, 12:52 AM »

I can use vb 9.0 as well but blv you me - after vb 6.0 i have been developing websites - i just popped in here and saw what some of you guys are doing and decided to contribute - no problemo - i will do it with both of them - but on one condition - i will have to get your guys to teach me the equivalents to some of the stuffs i am going to be talkin about - no problem - i think i have enough response to go on - i will continue this thread then - first i need to dust my library to gather those codes and start breaking it down so that we can all learn - and mind you - i am not a core vb programmer - so u guys should take it easy with me O when i write codes that are too long or outdated - i havent touched vb compiler for several years - but i can still pull this off anyway.
Kobojunkie
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #4 on: January 07, 2009, 04:41 AM »

Well, let's see what you have to post.
*dhtml
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #5 on: January 07, 2009, 07:25 AM »

I will start off later tonight. I will try my best though. I am tryin to get the sample codes out first.
dammytosh
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #6 on: January 08, 2009, 09:05 AM »

It is suicidal to start teaching au to use VB6.0 to build intranet applications wen the paradigm has drastically shifted in ASP.NET (VB.NET (VB 7,8 and even 9) ). I appreciate your contribution to knowledge but start a better lecture instead.
we are all ears.
*dhtml
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #7 on: January 08, 2009, 10:18 PM »

**** DHTML wonders what paradigm has to do with all this afterall you can alwayz upgrade your project to .NET or even rewrite it once you get to know the programming behind it - as far as i know, programming technique is the same, objects are objects, constructs only change. In other words, if i am a better programmer than you, and i learn the lang construct of .NET in say 1/2 months, i will still be better than you, programming has to do more with skills than any other thing. I am sure many ppl that are waiting to read what i have to say can use .NET well and will surely learn.

And by the way, wat i am going to post, i first did it in VB, then latter on i did it with VC++. Once you get the principle you can pull it off anywhere.

Having said that, i will be uploading the starting point soonest in vb 6.0, i will expect someone to help convert it to vb.NET 2005 for me to continue with it.
I have not touched vb.net since 2005! I am that rusty.
*dhtml
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #8 on: January 08, 2009, 10:34 PM »

Materials for this class, you will need to be running a local web server. you can use IIS or apache based servers if you like.
You will need to create a folder called intranet, that can be accessed by http://localhost/intranet.

i will supply contents and source codes as swe move on.
*dhtml
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #9 on: January 08, 2009, 11:14 PM »

Time to start off - please download - http://mwebng.net/intranet/step1.zip  - that is the start package. The .NET version will follow later.
lagerwhenindoubt (m)
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #10 on: January 12, 2009, 04:47 PM »

Long Live VB6
dammytosh
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #11 on: January 14, 2009, 09:16 AM »

Quote from: dhtml on January 08, 2009, 10:18 PM
**** DHTML wonders what paradigm has to do with all this afterall you can alwayz upgrade your project to .NET or even rewrite it once you get to know the programming behind it .
Upgrading to vb to vb.net is just like modifying your "C" code to work in "CPP" environment(it might work but u are not doing the right thing). they are two different things. Paradigm has a lot to do with wat we are talking about especially when it comes to WEB APPLICATION DEVELOPMENT. blif me or not, all your vb 6.0 codes in your Web App will likely not work in asp.net (VB) and even if it does eventually, it will be a worst programming practice not even bad.

Quote from: dhtml on January 08, 2009, 10:18 PM
  I have not touched vb.net since 2005! I am that rusty.
I see,    Check and see what i am trying to point out. It is different and the thinking is entirely different. I av written VB 6 (infact i wrote 3 board games Ludo, Draught and Snake And Ladder), VB 7,VB 8 and currently i use VB 9 and i can tell u dt there are some differences in d versions although microsoft will always allow backward compactibility for developers who are afraid of change.

I am all eyes too. but teaching VB 6 when VB 10 is almost ready is archaic nd ,


Kobojunkie
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #12 on: January 14, 2009, 04:14 PM »

Is it possible to see the Ludo, Snake& Ladder and other games you worked on ? @DammyTosh. I have been pondering the idea of building a Ludo game in Silverlight but so far, have not started. Seeing already existing application of the sort would go along way in helping me.
*dhtml
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #13 on: January 14, 2009, 11:24 PM »

vb 6.0 source code

Code:
Dim strHome As String
Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)

End Sub

Private Sub Form_Load()
On Error Resume Next
strHome = "http://localhost/intranet"
tb.Navigate App.Path & "\tb\main.html"
ie.Navigate strHome
End Sub

Private Sub ie_StatusTextChange(ByVal Text As String)

End Sub

Private Sub tb_TitleChange(ByVal Text As String)
On Error Resume Next
Dim Ret

Select Case Trim(LCase(Text))

Case "home"
ie.Navigate strHome

Case "back"
  Ret = ie.Document.script.history.Back(1)

Case "forward"
  ie.GoForward
 
Case "stop"
ie.Stop

Case "reload"
ie.Refresh

Case "exit"
Unload Me

Case "print"
   'printout
End Select

End Sub

vb 2005 [.Net] source code
Code:
Public Class Form1
    Dim strBrowser As String

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        strBrowser = "http://localhost/intranet"
        ie.Navigate(strBrowser)
        Dim str = Application.ExecutablePath

        Dim pos = InStrRev(str, "\")
        str = Mid(str, 1, pos - 1)

        pos = InStrRev(str, "\")
        str = Mid(str, 1, pos - 1)

        pos = InStrRev(str, "\")
        str = Mid(str, 1, pos - 1)


        pos = InStrRev(str, "\")
        str = Mid(str, 1, pos - 1)

        tb.Navigate(str & "\tb\main.html")



    End Sub

    Private Sub tb_DocumentTitleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb.DocumentTitleChanged

        On Error Resume Next
        Dim Ret

        Select Case Trim(LCase(tb.Document.Title))

            Case "home"
                ie.Navigate(strBrowser)

            Case "back"
                ie.GoBack()
               
            Case "forward"
                ie.GoForward()

            Case "stop"
                ie.Stop()

            Case "reload"
                ie.Refresh()


            Case "exit"
                Application.Exit()

            Case "print"
                'printout

        End Select

    End Sub
End Class

The 2 source codes are similar - just download and run the samples - anyone - i will do the explanations later [in case u have still not figured it out]
This is part 1 of the tutorial.
*dhtml
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #14 on: January 14, 2009, 11:34 PM »

So i am now back to continue (looks like you guys were playing snakes and ladders in my absence)

There is a little technical aspect i left out in the introduction. The core of the project is not vb code per se - it is web.

So we are going to be doing some javascripting and php as well.

So this is the complete step 1: http://mwebng.net/intranet/step1-b.zip [90 Kb]
Contains a sample web browser - same output but 2 langs - one with vb 6.0 and the other with vb 2005 [.NET]

The bulk of the task is not core vb per se - that was why i was wondering wat paradigm has to do with it.
I hate chest thumping but i code in at least 10 different langs very well (minus qbasic, visual basic 6.0/.NET).
And i can say it - that the more languages u learn - the easier it becomes for you to adjust. Think about it - if u learn vb 6.0 (freestyle - no strict declaration, no classes, no inheritance polymorphism, ), then you know went to learn say visual c++ (know u know how to use objects). If u now come back to learn vb .NET or Visual C# some years later - that will not take u so much time to learn if u knew the first 2 very well. If can use java (to develop complete Apps) - i see no reason why learning php should take u up to a month!

And by the way, maybe i did not say it before, i am a freelance software programming and website developer - the 2 aspects are one in my eyes - u either write codes, generate, manipulate and get results (plus your pay).


That was just a distraction really, so now back to our task.


* intranet.jpg (110.26 KB, 1021x732 )
dammytosh
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #15 on: January 15, 2009, 12:16 PM »

Quote from: Kobojunkie on January 14, 2009, 04:14 PM
Is it possible to see the Ludo, Snake& Ladder and other games you worked on ? @DammyTosh. I have been pondering the idea of building a Ludo game in Silverlight but so far, have not started. Seeing already existing application of the sort would go along way in helping me.
@Kobojunkie,
   Yes u can.just give me a week to dig into my archive. I am kind of busy 4 now.  i am even planning to upload the source code in the nearest future but i need 2 refine it cos i built d apps during my undergraduate days.

@dhtml,
 u just ran into the problem i forsaw when u said u will JUST convert the VB6 codes to VB 8.
  Oga, Please concentrate on your VB 6.0 code. i cant stop laughing when i saw your VB 2005 Code [That code sucks].
(I wonder wat asp.net (VB) developers in the house are doing.)  Huh
  The fact still remains that NO PROFESSIONAL VB 8 developer will use your approach 2 build web application. (That stuff is just like using "GO TO" statement in Modern programming language (It will work but it will defeat the purpose of redefining d language.) ). So dont confuse young VB.net developers in the house.

Still enjoying your vb 6 tutorials Kudos.
Big Star (m)
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #16 on: January 15, 2009, 03:41 PM »

As for me, I do alot of coding with VB6.0 VB.Net, SQL, PHP, plus web design, XML web services

and many more to know
*dhtml
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #17 on: January 15, 2009, 09:23 PM »

To the programmers in the house, like i said i no longer use vb .net - i did the original project at a time when there was no vb .net - i made the first copy with vb 6.0 but later rewrote it with vc++ 6.0 - but like i said - i have been in web development all this while (so i am quite outdated) - but the bulk of the matter rest more with php/mysql.

The next step now will be how to start and stop apache based servers such as reactor and wamp.
What we are aiming for here is that (UNLIKE IIS - I SAID IT) - you can bundle the apache server files along with your application using your MSI package. Now on getting to the client machine - your program should be able to start and stop the apache based servers - and should also be able to detect when the server is running and when it is not.

Let me leave it open here - if anyone knows of a simple way to accomplish that task - please post it here - before i post my degenerate but working code.
*dhtml
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #18 on: January 15, 2009, 09:59 PM »


Some insight into starting and stopping those apache web servers - if you are using the reactor server - there are some bach files (.bat like install.bat) somewhere inside type folders (for those of you that did not master batch file processing on msdos[new generation programmers] - batch files are scripts that contain msdos commands - they are not oop like php - similar to unix shell scripts and they are text files too).
You will find some commands in those batch files that can start and stop the server. Basically you can start the apache server by running the shell command. The command in vb 6.0 used to be shell(),  but i prefer to use the win32 api like shellexecute command.

I actually created a dll module with vc 6.0 to start and stop the server, the dll works with .NET too (it is a standalone dll rather in same class as kernel32.dll and user32.dll) - but we can still rewrite those functions in here. I do not wish to distract this place with dll creation in visual c++ 6.0 (that will be a degenerate topic?) - ppl want to know how to create assemblies in .NET - lol
Kobojunkie
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #19 on: January 17, 2009, 04:56 AM »

To create a Dll
================

1) Open Visual Studio

2) From the file menu, select NEW > Project

3) From the New Project menu, select Class Library for the language you want to work with ( I am using Visual STudio Professional, so I first need to make sure I have the Language selected in the Project types area) . Note that you can also build a dll with some of the other templates on there.

4) Click OK

You now have a project in Visual Studio. You can choose to add code for your objects in the .CS class if you want. But for this example, we just need a dll.

5) Right Click your project folder in the Solution Explorer pane. Select Build

6) Once build is done, look in the bin folder of your project. Bin > Debug and you will find your dll.


Very easy!


* Visual Studio 2008 New Project Dialog box.jpg (82.11 KB, 804x540 )
*dhtml
Re: Vb 6.0/vb .NET & Intranet/internet Application Development
« #20 on: January 17, 2009, 05:46 PM »

Thanks alot for that - since our last discussion, i have been studying and practicing vb.net and vc# - i will try out the dll stuff.
The project will look better if it is broken down into components - i am still tryin to brush up - i will return to this thread later.
 Programming In Asterix  Structured Programming As A Panacea For Software Crisis. Discuss  Another Bill Gate In Nigeria  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.