Myanmar IT Resource Forum
Myanmar IT Resource Forum
Myanmar IT Resource Forum

You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

sHa92

sHa92
Founder



Founder
က်ေနာ္ အခုေရးေပးမယ့္ Code ေတြကေတာ့ Network ထဲမွာရိွေနမယ့္ Computer နာမည္ေတြကို List လုပ္ၿပီး ထုတ္ေပးမယ့္ Code ပါ။
Console Application အတြက္ေရးထားတာၿဖစ္ပါတယ္။ နားလည္ၾကမွာပါ...

Code:
Sub Main()

            Dim root As New DirectoryEntry("WinNT:")

            Dim parent As DirectoryServices.DirectoryEntries       

            parent = root.Children       

            Dim d As DirectoryEntries = parent       

            For Each complist As DirectoryEntry In parent     

                For Each c As DirectoryEntry In complist.Children           

                    If (c.Name <> "Schema") Then               

                        Console.WriteLine(c.Name)               

                    End If           

                Next

          Next   

End Sub

http://www.myanmaritresource.info

sHa92

sHa92
Founder



Founder
GUI အေနနဲ႔ ေဖာ္ၿပခ်င္တယ္ဆုိရင္ေတာ့ Combobox (သို႔မဟုတ္) ListBox ထဲကေနၿပီးေတာ့ ေဖာ္ၿပလုိ႔ရပါတယ္။ ေၿပာင္းရမယ့္ Coding ကေတာ့ For Loop ေနရာမွာ ေၿပာင္းရမွာပါ။
Code:
For Each c As DirectoryEntry In complist.Children

          If (c.Name <> "Schema") Then

                      ComboBox1.Items.Add(c.Name)

          End If

Next

http://www.myanmaritresource.info

မုိးတေစၦ

မုိးတေစၦ
MITR New User



လန္းတယ္ဗ်ဳိ႕ Bro ကၽြန္ေတာ္က vb.net ကိုအခုမွ စလုပ္ေနတာ
စမ္းၾကည့္လုိက္အုံးမယ္ Form Application စာအုပ္ေကာင္းေကာင္းေလးေတြရွိရင္လည္း မွ်ပါဗ်ဳိ႕
Very Happy

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum

 

Create a forum on Forumotion | ©phpBB | Free forum support | Report an abuse | Forumotion.com