|
This is the VB.NET version:
Dim inPar, outPar As ManagementBaseObject
Dim mc As New ManagementClass("Win32_NetworkAdapterConfiguration")
Dim moc As ManagementObjectCollection = mc.GetInstances()
For Each mo As ManagementObject In moc
If DirectCast(mo("IPEnabled"), Boolean) Then
inPar = mo.GetMethodParameters("EnabledStatic")
inPar("IPAddress") = New String(){"128.10.63.63"}
inPar("SubnetMask") = New String(){"255.255.0.0"}
outPar = mo.InokeMethod("EnableStatic", inPar, Nothing)
Exit For
End If
Next
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Thank u Mr. Richard Deeming for the code conversion!!!!! Some error were found but After removing these the following code is best!!!! (with running condition)
Dim inPar, outPar As ManagementBaseObject
Dim mc As New ManagementClass("Win32_NetworkAdapterConfiguration")
Dim moc As ManagementObjectCollection = mc.GetInstances()
For Each mo As ManagementObject In moc
If DirectCast(mo("IPEnabled"), Boolean) Then
inPar = mo.GetMethodParameters("EnableStatic")
inPar("IPAddress") = New String() {"128.10.63.65"}
inPar("SubnetMask") = New String() {"255.255.0.0"}
outPar = mo.InvokeMethod("EnableStatic", inPar, Nothing)
Exit For
End If
Next
End Sub
Any query related to VB.NET+Network Programming
email: sharma.hariomprakash@gmail.com
|
|
|
|
|
|
He's looking for code to CHANGE the IP, not just get the current IP's.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
|
I have following code in vb.net which can change system name of a local system. But it only works on WinXP. Is there any another way the same does on Win2000?
Dim name, password, username As String
name = "Studio11" '' new system name
'password = "area" '' may be NULL
'username = "Studio" '' may be NULL
Dim t As Single
Dim objWMIService, objComputer As Object
objWMIService = GetObject("Winmgmts:root\cimv2")
' Call always gets only one Win32_ComputerSystem object.
For Each objComputer In objWMIService.InstancesOf("Win32_ComputerSystem")
t = objComputer.rename(name, Nothing, Nothing)
MsgBox(t)
If t <> 0 Then
'WScript.Echo("Rename failed. Error = " & Err.Number)
MsgBox("ERROR")
Else
'WScript.Echo("Rename succeeded. Reboot for new name to go into effect")
Dim res As String = MsgBox("User Name/Password has been changed! Please restart your system!", MsgBoxStyle.YesNoCancel + MsgBoxStyle.Information, "Restart Now")
If res = vbYes Then
'restart your system
End If
End If
Next
Any query related to VB.NET+Network Programming
email: sharma.hariomprakash@gmail.com
|
|
|
|
|
As documented here[^], the Rename method only works on XP and Vista. 2000 is not supported.
If you want to rename the computer on just about every version of Windows, you'll have to call the Win32 API function SetComputerName[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a LAN.
When i tried to connect to computer in workgroup, It want to enter Username and password. How can i disable such message? On that computer i coudn't find such setting.
|
|
|
|
|
it asks the username/password of an account of the deestination machine.
if the computer you're connecting is protected by members accounts, then you cannot bypass this rule. it is exactly the same when you are physically on the computer, and wish to log-on on it...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
It has only one Account with admin privilages. Yesterday i had an acsess, but today it requires. I have restarted both machines without any sucsess. And used connection wizzard on both machines without any sucsess.
|
|
|
|
|
It worked yesterday because the account you used on one machine had the same username and password the other machine recognized. This is because each machine in your workgroup has it's own set of user accounts and passwords.
The only sure-fire way around this is to reconfigure your workgroup LAN setup into a domain environment. That way, every machine in the domain will use a single set of user accounts.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I don't know nothing abaout domain. Where can i get some info, What it is, How to set up and What are advantage of domain.
|
|
|
|
|
You can start with the XP Resource Kit. I highly recommend picking it up. It's the best $40 US you'll spend if you want to know how every works in XP.
Here's[^] a real quick introduction to the concepts.
And a little more[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
From the link it seems it requires a client with Windows 2000/2003, I don't have those windows, and i don't want to make my computer a client. This is a home network, and the domain is out of my reach.
Is it possible to set a Username and password without a domain? And if so How?
I am using Windows XP SP2
|
|
|
|
|
Again, you have 2 machines, each with it's own accounts and passwords. Ther eonly way this is going to work WITHOUT a domain is if the account names and passwords match on both machines. If you change the password to an account on one machine, you have to change it on the other. There is no other way around this besides a domain.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Both of your computer mush have:
- The same user account name and password.
- The same workgroup name.
- The same IP address network id (but difference host id. Exp: 192.168.1.1 and 192.168.1.2).
|
|
|
|
|
Roath Kanel wrote: The same user account name and password.
True.
Roath Kanel wrote: The same workgroup name.
Not true. Both machines can be in completely different workgroups since each machine, not workgroup, maintains its own account database. So long as the usernames and passwords match, workgroup information doesn't matter.
Roath Kanel wrote: The same IP address network id (but difference host id. Exp: 192.168.1.1 and 192.168.1.2).
Definately not true. The IP address/Network address has nothing to with authentication between two machines.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote: Not true. Both machines can be in completely different workgroups since each machine, not workgroup, maintains its own account database. So long as the usernames and passwords match, workgroup information doesn't matter.
Ok, i agree.
Dave Kreskowiak wrote: Definately not true. The IP address/Network address has nothing to with authentication between two machines.
It is not for purpose of authentication. But it is in purpose of communication. Is it possible if the first computer ip address is 192.168.0.1 and the second computer is 192.168.1.1?
|
|
|
|
|
So long as there is a route between the two networks, this is not a problem.
If there is no route, he wouldn't be able to contact the other machine at all. If that was the case he'd never get the login box he says he's getting.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi System Adminstrators
In a networked environment, how would a network administrator handle an unsigned Excel Add-in that needs to be accessed by several individual computers on the network? Does a network administrator have the ability to create a selfcert.exe type certifcate so that the add-in can be treated as a trusted source and allowed to function on the network? Or would it be necessary to install the Add-in on the C: drives of the relevant users' computers?
I hope this makes sense and isn't too vague
Thanks
Jeremy
|
|
|
|
|
JSadleir wrote: how would a network administrator handle an unsigned Excel Add-in that needs to be accessed by several individual computers on the network?
Just share it from the server machine and import this add-in in an excel.
|
|
|
|
|
Hi everyone, this is my problem..
I recently got a 24/7 internet (cable) connection, and I'd like to use it 100% by keeping my PC running 24/7, even when I'm away for the weekend. To make it simple: I need to enable autologin to my account, run some apps (for downloading) and then lock the workstation so my roommate can't mess with my personal files.
My OS is WinXP SP2, if that matters at all.
Is there a way to do this without buying some specialized apps?? Every idea is welcome
---
http://sprdsoft.cmar-net.org - We Sprd You Softly
Our site features contents and several images. All of this is very weird.
In the end, war is not about who's right, it's about who's left.
|
|
|
|
|
Set the screensaver to activate after 30 seconds (or whatever you want) and enable the password protection checkbox.
Automating Logon[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote: Set the screensaver to activate after 30 seconds
The minimum value is 1 minute (60 seconds) only
|
|
|
|