|
hey here is a loop that will find the free space and save it as a variable:
'needs this
imports system.xml
'the loop that runs a test on 4 drive with specified drive letters but you can change that to where it uses all drives on the machine
Dim fso As New Scripting.FileSystemObject
Dim drv As Scripting.Drive
For Each drv In fso.Drives
If drv.IsReady Then
If drv.DriveLetter = strDrive1 Then
decDrive1 = drv.FreeSpace
FreeDriveSpace1 = ((decDrive1 / 1024) / 1024)
End If
If drv.DriveLetter = strDrive2 Then
decDrive2 = drv.FreeSpace
FreeDriveSpace2 = ((decDrive2 / 1024) / 1024)
End If
If drv.DriveLetter = strDrive3 Then
decDrive2 = drv.FreeSpace
FreeDriveSpace3 = ((decDrive2 / 1024) / 1024)
End If
If drv.DriveLetter = strDrive4 Then
decDrive4 = drv.FreeSpace
FreeDriveSpace4 = ((decDrive4 / 1024) / 1024)
End If
End If
Next drv
Hope this helps you out.
ccotton333
|
|
|
|
|
You can DISPLAY it any way you choose...
A quick search on Google gives may ways to GET it though. Here is one:
http://www.freevbcode.com/ShowCode.asp?ID=5588[^]
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
I set form autoscale property to false. But the label font is still autoscaled. How can I disable the font size from auto scaling?
|
|
|
|
|
Here's an odd problem. I created a datagrid to allow the user to select a record from a list and then return to the main program. If the user types somthing into a row (like a name) and hits enter the grid drops down to the correct spot. The only problem is that what ever the user typed into the row is saved to the DS on the record that was at the top of the display. The other items in the row remain unchanged. this makes it look like the all the data in the row is related to the one changed text box. The changed text stays until the data set is re-read.
|
|
|
|
|
Hey all,
I was wondering if there was a way to use sockets to check if a file exists on the remote machine, and if it exists, read the data from the file and store it into another file on the connecting machine. I'm new to sockets and i have never done anything with them, but if someone could help me or tell me if this is even the right direction to go with what i'm trying to do, I would greatly appreciate it.
Thanks everyone,
ccotton333
|
|
|
|
|
i have tried this and it won't work because oa a blank password issue does anyone know how i could resolve this here is my code:
Try
Dim sinfo As System.Diagnostics.ProcessStartInfo
sinfo.Arguments = "use z: \\server1\alarms /user:Administrator "
sinfo.FileName = "c:\windows\system32\net.exe"
System.Diagnostics.Process.Start(sinfo)
Catch
MsgBox("the mapping didn't work")
End Try
thanks for all your help,
ccotton333
|
|
|
|
|
If the machines your using for this are in the same domain, this wouldn't be necessary as each machine in the domain shares the same trusted accounts and tokens.
Since it is asking for a password, I take it the machines are in workgroup mode. This means that each machine maintains its own accounts and doesn't trust accounts and tokens from any other machine.
You need to supply a valid account and password for the machine that your trying to map a drive to. You might have to fiddle with this to get it to work, but your command line should be something more like:
NET USE Z: \\machineName\shareName myPassword /USER:machineName\Administrator
Try typeing it at a command line first. Get it to work there, ther you can move what works for you into your code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
There is not way to do this using sockets unless you write a server application that will listen for requests and carry out what you want. You also have to write the client side application to actually make the request, obviously.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for your response. Well i do have a web server side and a SQL server side and the problem is that the SQL server can't reach the internet and i'm trying to figure out how to send a email out to me to alert me when a certain process occurs and i can map a drive and both sides work or i can try to view the directory of the alarm path and i supply a username and password and it works great. but when i log off the program can't reach the SQL server from the Web Server and i need to be able to access the SQL server. If you could give me any advice on how to go about this i would appreciate it.
Thanks
ccotton333
|
|
|
|
|
What you said didn't make ANY sense what-so-ever. Try focusing on one topic, it'll be much easier to understand you.
ccotton333 wrote:
Well i do have a web server side and a SQL server side and the problem is that the SQL server can't reach the internet
Are you saying that you have two machines, one IIS and one SQL? Are you saying that you can't see the SQL server from a machine on the Internet?
ccotton333 wrote:
and i'm trying to figure out how to send a email out to me to alert me when a certain process occurs
It's easy enough to send email. Check into the System.Web.Mail namespace. What process that occurs to trigger this depends, well, on what you're monitoring for.
ccotton333 wrote:
i can map a drive and both sides work
What? What sides? What do you mean by work?
ccotton333 wrote:
i can try to view the directory of the alarm path and i supply a username and password and it works great.
I have no idea what you're talking about here.
ccotton333 wrote:
when i log off the program can't reach the SQL server from the Web Server
I take it you have an IIS server on one machine and an SQL server on another machine. What program? Log off? What are you talking about?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ok basically i have IIS on the webserver and then i have a private network between the SQL server and webserver. the LAN is also on another private lan an and all pcs on that lan can access the internet. so i have this SQL server that cannot reach the internet and i have written two programs one to run on the SQL server and one to run on the webserver that check on the SQL server for the alarm messages. when i am working on the webserver and have established a connection between it and the SQL server(i.e. connect using remote desktop or through the run dialog and enter in the username and password) i can run each program on the machines and they run great but when i set it up to run as a service. it seems to lose the connection between the two servers and doesn't run as it should. any ideas as to what i'm doin wrong?
Thanks,
ccotton333
|
|
|
|
|
That's better! It's perfectly understandable now! See what happens when you slow down, take a deep breath, and use puncuation?
The problem you have is the account that your service is running under on the IIS machine. By default, this is the LocalSystem account, which only has rights to, obviously, the local machine. It doesn't have any rights to network resources since the account is local to the IIS machine.
Now, what you have to do is run your service under an account, just like any other user account, that has the appropriate rights it needs to the IIS box AND, to make this easier, because these two machines are not in the same domain, this exact same account and password must also exist on the SQL box.
Right-click "My Computer", pick Manage, then open Services and Applications in the left pane, then click on Services. Find your service in the right pane, right-click it and pick Properties. Click on the LogOn tab and you'll find where you can change the account that the service runs under. Oh yeah...create the account first, on BOTH machines.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
WHERE (AccountsEntries.Posted = 'No') AND ([References].Date >= @Begin) AND ([References].Date <= @End) GROUP BY AccountsEntries.AccountNo
-----
From my SQLdataadapter wizard (i use wizard to conenct to database), i type part of sql statement above in query builder and i want to insert parameter value to @Begin and @End from VB.code.
How to do it?
|
|
|
|
|
Hi,
I have problem with datagridview - i want to do this: if i click in button, i have show a name selected with this dataview in messageBox , but i don't know how do it ;( I beginner in basic ;( Whose know how make it??
I want get selected name...
btw. sorry for my english
|
|
|
|
|
can anyone help me correctly validate some textboxes?
Makniteasy
|
|
|
|
|
Hi! I am Vijay Anand. So you have a problem on validating
textboxes. I am a programmer in VB.
There is two type of validation in One type of checking is don't allow the user to type the false values and the another one is check the value while the user leaving the text box. For further info please send me a email at imagicvijay@gmail.com.
Vijay V Anand
|
|
|
|
|
Vijay V Anand wrote:
Hi! I am Vijay Anand.
hi, i'm toxcct
Vijay V Anand wrote:
So you have a problem on validatingtextboxes.
great, what a good reader !
Vijay V Anand wrote:
I am a programmer in VB.
hum, you know, we're all here on that forum supposed to be VB6 and/or VB.NET programmers...
Vijay V Anand wrote:
For further info please send me a email at imagicvijay@gmail.com.
definitely NO !!!
the principle of the forum is to share ! e-mail a privates, so kill the sharing point. don't do this
ps: when you say so much things while not even answering the question (i say so because i don't see at all in how you help the guy), then, avoid posting...
one last thing... you got my 1
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
well I guess Vijay is looking for some family friends. I am really happy to know that vijay is a Programmer in VB other wise I thought that on this forum we used to discuss JAVA and Unix.
Thanks Vijay you made us clear that atleast we have one VB programmer with us..
|
|
|
|
|
What kind of validation are you performing? Are you working with VB6/VB.NET?
<italic>Work hard, Work effectively.
|
|
|
|
|
|
What kind of validation?
<italic>Work hard, Work effectively.
|
|
|
|
|
Hi! I have this dilema. I have to pull data from DB to Excel. But the deploy machine has Windows 98, so Visual Studio Tools for Office does not work on win 98... any suggestions?
Thanks!!!
Agustín
|
|
|
|
|
Hi,
Im trying to search through an XML file. When it finds the record it needs it then updates a specific field in that record. I have made it find the specified record but do not know how to update it and write it back to file. I am new to XML coding. Any help would be most appreciated.
Dim xpathDoc As XPathDocument
Dim xmlNav As XPathNavigator
Dim xmlNI As XPathNodeIterator
Dim filePath As New OpenFileDialog
filePath.ShowDialog()
xpathDoc = New XPathDocument(filePath.FileName)
xmlNav = xpathDoc.CreateNavigator()
xmlNI = xmlNav.Select("/Message/Pupils/PupilCode")
While (xmlNI.MoveNext())
System.Console.WriteLine(xmlNI.Current.Name + " : " + xmlNI.Current.Value)
If (xmlNI.Current.Value) = "A123981456002" Then
'ONCE ITS FOUND THE RECORD - DISPLAY A MESSAGE
'SELECT THE DIFFERENT FIELD WITHIN THE RECORD
MsgBox("Found")
xmlNav.Select("/Message/Pupils/PupilAge")
'THIS IS WHERE IT NEEDS TO UPDATE IT. NO IDEA HOW TO DO THIS BIT
End If
End While
This may be the wrong way to do it - I'm not sure. I just need it to search for a specific pupil ID and update their age with a specified value. After that it has to write the entire XML file to a new file.
Many thanks.
Chris
|
|
|
|
|
|
I developed a project that generates a xml file form a database and upload it to a webserver. I think it is possible to check the generated xml file having virus or any harmful threat. So i want to trigger the anti virus software to scan that xml file and if no threat was found then upload that file or inform that the file has a virus.
Please any of one help me to accomplish this task, the main thing is the source must be in VB 6.0 :(code.
Vijay V Anand
|
|
|
|