I need to know some visual basic codes

Questions about programming languages and debugging
Post Reply
eppik
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 212
Joined: 26 Mar 2006, 16:00
14
Location: Infinite Loop
Contact:

I need to know some visual basic codes

Post by eppik »

First of all thanx for answering (if you did)


The first code:

Im making a web browser, all the buttons are set to the usual functions (refresh,stop,go,goback,goforward,home)
I now need to know how do i make a textbox (text1 is the name of the object) show the IP of the current site by clicking a button (btn1)

the name of the webbrowser window is 'wb'




The second code:


I need to know how to make a textbox show the current available space in a hard drive by clicking a button

I know the code get the available space but dont know how to make the box show it

is this the

Code: Select all

Dim freeSpace As Long
        freeSpace = My.Computer.FileSystem.GetDriveInfo("C:\").TotalFreeSpace
this is the code for the C:\ drive

User avatar
FrankB
Ph. D. in Sucko'logics
Ph. D. in Sucko'logics
Posts: 315
Joined: 06 Mar 2006, 17:00
14
Location: Belgistahn
Contact:

Post by FrankB »

Why do you want that browser application to know the volume of a disk ?
.. and what if there were several disks ?

eppik
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 212
Joined: 26 Mar 2006, 16:00
14
Location: Infinite Loop
Contact:

Post by eppik »

i dont want a browser to check the disks its another aplication im building

i need the browser to tell me th ip of the site your in

User avatar
CommonStray
Forum Assassin
Forum Assassin
Posts: 1214
Joined: 20 Aug 2005, 16:00
15

Post by CommonStray »

for your HD space to be shown simply go into your button (code) after you declare your variable and define what it is (code you put into post) simply take your freespace variable and have it output to something like a text box or list box...

Code: Select all

text1.text = freespace
somethings like this, remember your variable will keep the same information its assigned until you change it ;)


[/code]

eppik
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 212
Joined: 26 Mar 2006, 16:00
14
Location: Infinite Loop
Contact:

Post by eppik »

thanx a lot m8 :o

but i didnt quite understand it so


lets say i have button1 and textbox1

i write the code to check the HD :

Code: Select all

Dim freeSpace As Long
        freeSpace = My.Computer.FileSystem.GetDriveInfo("C:\").TotalFreeSpace

then what i do? i insert textbox1.text = freespace

hmm WTF?! w8 a minute!! in that code....and in the box....

Dim freeSpace As Long
freeSpace = My.Computer.FileSystem.GetDriveInfo("C:\").TotalFreeSpace


and then texbox1.text = freeSpace

OMG its just like Phyton's code when you want it to show a result or smthng:

freespace = input("What is the freespace")

then you write:

print "the freespace you entered early is", freespace


OMG i got it

CIRCUITBomB YOUR A GENIOUS!!!



PS: lol

User avatar
zigo
suck-o-fied!
suck-o-fied!
Posts: 88
Joined: 07 Jul 2005, 16:00
15

Post by zigo »

here u can find alot of tut for visual basic u may not have the answer for ur exact question there but u may need that for later there is great tutorials there so that is why i wanted to ahre this link with you and sorry if i got off topic a bit it's just we are talking about visual basic and i tought i cud post this helpfull link for visubasic .

Post Reply