|
Hello
i read ur question and i want to know some more details of ur question. R u want IP address for local Domain or for particular site....
i m sending u code which is used to find Work group/Domain in ur LAN. and check that which is pc is Active in that LAN and will also show the IP Address...
'---------------------------------------------------
'Method for Finding Domain/WorkGruop
Public Function GetDomain() As String
Dim WGroup As String = ""
Dim query As New SelectQuery("Win32_ComputerSystem")
Dim searcher As New ManagementObjectSearcher(query)
For Each mo As ManagementObject In searcher.Get()
WGroup = mo("Domain")
'MsgBox(WGroup)
Next
Return WGroup
End Function
'---------------------------------------------------
'---------------------------------------------------
'Method for Finding IP Address of and node no which are Active in LAN
Public Sub ListComputers(ByVal TView As TreeView, ByVal WorkGroup As String)
Try
TView.Nodes.Clear()
Dim AllComp As New TreeNode
AllComp.Text = Form1.groupname
AllComp.ImageIndex = 1
AllComp.SelectedImageIndex = 1
TView.Nodes.Add(AllComp)
If WorkGroup.Trim() = "" Then
MessageBox.Show("Please provide a Domain Name.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End If
Dim DomainEntry As New DirectoryEntry("WinNT://" & WorkGroup.Trim())
DomainEntry.Children.SchemaFilter.Add("computer")
For Each Machine As DirectoryEntry In DomainEntry.Children
Dim CompNode As New TreeNode(), CompInfo(1) As String
CompInfo(0) = Machine.Name
Dim Tempaddr As System.Net.IPHostEntry = Nothing
Try
Tempaddr = DirectCast(Dns.GetHostByName(Machine.Name), System.Net.IPHostEntry)
Dim TempAd As System.Net.IPAddress() = Tempaddr.AddressList, str As String = ""
For Each TempA As IPAddress In TempAd
CompInfo(1) = TempA.ToString()
Form1.ListBox1.Items.Add(TempA)
Next
Catch ex As Exception
CompInfo(1) = ""
End Try
CompNode.Text = CompInfo(0)
CompNode.ToolTipText = CompInfo(1)
CompNode.ImageIndex = 0
CompNode.SelectedImageIndex = 0
AllComp.Nodes.Add(CompNode)
Next
TView.ExpandAll()
Catch ex As Exception
End Try
End Sub
'---------------------------------------------------
|
|
|
|
|
Hi Dharmchand,
Thanks for your help ,
but my requirement is to get Ip addresses of a particular domain .
whose IPAddress is known.
|
|
|
|
|
hi...
i hve a mdi form and i added 4 buttons in the mdi form. these buttons are shortcuts of child forms. when i open the child forms , these buttons are showing front, ie, the child form is behind these buttons... can any one help to sortout this..
Tnks in advance..
|
|
|
|
|
Try BringToFront() or SendToBack()
|
|
|
|
|
i already tried that..
wen i used Mdi.sendtoback() --> the window is going hide/ minimised.
wen i used Chil.bringtofront() --> there z no effect.
|
|
|
|
|
This is a double post and you apparently did not take my suggestion from the first time
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Hello,
I have got a question regarding the textbox-control.
Is it possible to resize the input area of a textbox (in a inherited class) by keeping the controls width and height unchanged?
I want place a button right next to the input area. If the user presses the button (or the F4-Key on his keyboard) the textbox should open a Lookup-Form (this is not the problem). This can easily be done by adding a button-control to the ControlCollection, adding a handler to the button's Click-Event and overriding the PreProcessMessage-Function for checking the F4-Key. But I couldn't find out, how to change the size of the input-area, so that the button and the textbox doesn't overlap eachother.
I tried to write an User-control. This works nice, but the User-Control hides all of the Textbox-Properties which I need. So I had to write some kind of wrapper to make them visible again - and this is not really nice.
I would be pleased if someone could give me a hint.
PS: I'm sorry for my bad english-skills.
|
|
|
|
|
Your best bet is to do what you're doing. The textbox is a nasty control, very difficult to derive from b/c it paints itself outside of it's paint event.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Hi Christian,
thanks for your reply. I've wondered why overriding the OnPaint-method does not do anything. Even setting the eventargs to nothing doesnt prevent the control from painting.
I've got two fuether Questons:
- Could you (or someone else) give me a link to the "internals" of the Textbox-Control (MSDN just explain how to make use of the properties, painting is not explained there).
- The Textbox-Control has a nice sizing feature: If Multiline is disabled, the control's height can't be set by Drag'n Drop in Design-Mode. I would like to have such a feature in my UserControl too. How can this be done?
TribleX
|
|
|
|
|
hi,
i'm using VS2008 working on windows application vb.net...
i want to sending data on my listbox through comm RS232, here my code,
dim a as byte
a = convert.tobyte(listbox1.items(3))
the data in that listbox is "85" for example.. then after sending it to comm, the application that receive it show "38 35" where it is in hex.. i'm confusing now why it didn't show "55" where is the correct answer in hex..
plz help me i'm try to do almost two weeks..
|
|
|
|
|
You can't convert a string to a byte. You can convert a char to a byte, but a string is a byte/char array
85 is two characters - 8 and 5. 8 is 38 in hex, and 5 is 35. This is made all the more clear by 35 being 3 less than 38. If you want to convert a number to hex, use a ToString overload, you're looking in the wrong place and confusing yourself.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
If you have a decimal number string to convert to a byte, you should use the Byte.Parse method. You can also convert hexadecimal numbers if you use one of the overloads that takes a Globalization something or other flag.
|
|
|
|
|
Can we have a static block in VB.net just like we have in java ?
If yes can you please provide me a syntax for it !
|
|
|
|
|
Your question gives the answer. A static method or property in VB is called Shared.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
|
A 'static' initializer block in Java is really just a static constructor.
So...
class Foo
{
static
{
...
}
}
just converts to:
Friend Class Foo
Shared Sub New()
...
End Sub
End Class
(via 'Java to VB & C# Converter')
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
ok thanks i go through it
|
|
|
|
|
Hi folks
Hope you can give me a hint, I've spent 3 days trying to sort this out!
Working in visual studio 2005 proff, with .net framework 3.5.
Application has got various forms that are children of a parent.
All are loading, adding, saving and deleting fine. Apart from one.
I've tried an insert and made it a scaler. I've tried all sorts and just cannot get this to save.
It will do MemberID (Primary key) ClientsMare, and clientsid(fk) but clientsname, maresname, percentage no go Here's the Public Sub for Saving.
Public Sub SaveMember()
Adding = False
Deleting = False
lblMemberID.Text = CurrentMemberID
Me.SyndicateMembersBindingSource.EndEdit();
Me.SyndicateMembersTableAdapter.InsertMember(CurrentSyndicateID, MaresName, CurrentMareID, CurrentPercentage, CurrentClient)
Me.SyndicateMembersTableAdapter.Update(Me.DachelDataSet.Tables("SyndicateMembers"))
Welcome.btnSave.Enabled = False
'ONCE FINISHED NEED TO MAKE THIS FILL TO A FILLBYSYNDICATEID
Me.SyndicateMembersTableAdapter.FillByMember(Me.DachelDataSet.SyndicateMembers, CurrentMemberID)
Welcome.btnAdd.Enabled = True
End Sub
any ideas why I'm having this prob on just one form?
Thanks
Kris MCP
|
|
|
|
|
Because you're using the nasty built in stuff, you're just plain hoping it magically writes the right SQL for you. Write your own SQL and then you'll have control over what it does.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Thanks for that, I'll do that. Sorry for the late reply, been in meeting all day.
Kris MCP
|
|
|
|
|
i have some problems to do a rotation in vb.net.. i found out a few codes but when i applied it in vb.net...it failed..
i hope someone can helped me. tq
|
|
|
|
|
dunkin_ina wrote: i have some problems to do a rotation in vb.net..
Rotation of what?
dunkin_ina wrote: i found out a few codes but when i applied it in vb.net...it failed..
What do you mean exactly with "failed"?
dunkin_ina wrote: i hope someone can helped me.
Not likely unless you get a lot more specific...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
actually..i want to rotate a map..like to do a automatic rotation to a maps for vehicle used. i'm using visual basic 2008 to do the coding for the rotation, but i dont know how to specified the code just for rotation part.
|
|
|
|
|
If you want to rotate an image, then the grapics object as a rotation transform. But, as others ave said, we're left guessing waht you want as you give us nothing to work on.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
here, i just want to know how i'm supposed to rotate the map / object in vb.net?..what code should i use..
|
|
|
|