|
I used the same class n namespace n passed WinNT: as the query but it lists all the domains n workgroups together.I need those separately.Also I want to get the machines in the workgroup.Whats the query that I should pass.Plzzz replllyyyyy
|
|
|
|
|
I think the key is to enumerate the Properties collection of each child node in the collection of DirectoryEntry children. While there may be a more elegant way of doing so, the way that I was able to get a list of users, for example, was to do something like this:
Dim entry As New DirectoryServices.DirectoryEntry
For Each child As DirectoryServices.DirectoryEntry In entry.Children
Dim propertyValue As Integer = 0
Try
propertyValue = CType(child.Properties("UserFlags").Value, Integer)
Catch ex As Exception
' if it throws an exception, it's not a user item
propertyValue = 0
End Try
If (propertyValue = 513) Then
Console.WriteLine(child.Name)
End If
Next
If you look at the property names in the Properties collection, you should be able to isolate which ones are Domains, which ones are workgroups and which ones are users, etc. I believe there may be a more elegant solution, but I haven't found the best reference for that solution yet.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Hi,
I'm doing immediate syntax check for VBScript code sentence.
How can i get VBScript compiler error information, such as "expected expression"?
Thank you!
Alan
|
|
|
|
|
Although I'm not entirely sure what your asking, the whole enchilada can be found here[^]
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
the windows task manager application tab shows the application name as wellas the icon associated to that application/process.
i was making a listup of the applications that were running [task manager clone]
this i did by using the enumWindows API along with checks on the style sof the window handles obtained
and it is working
however dunno how to display the icon associated with a process.
any advice!!
|
|
|
|
|
Hello,
This is not to sound stupid, but can anyone please clarify the meaning of ADO.NET in the context of Visual Basic.NET. Please give a simple illustrative example on how ADO.NET work with VB.NET.
Cheers
|
|
|
|
|
Once upon a time, Microsoft created a standard set of API's that allowed programmers to access SQL and ODBC databases through a common programming interface. Since Microsoft's flagship technology at the time was known as ActiveX, they called it Active Data Objects, or ADO.
When they decided to create a whole framework for developers to extend or implement in their code (.NET), they updated the acronym to comply with the new framework terminology, so they called it ADO.NET.
MSDN: ADO.NET provides consistent access to data sources such as Microsoft SQL Server, as well as data sources exposed through OLE DB and XML. Data-sharing consumer applications can use ADO.NET to connect to these data sources and retrieve, manipulate, and update data.
In VB.NET, this means that you can use the classes in System.Data (SqlClient and OleDb and their children) to access data stored in databases.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Dear Colleagues,
Could anyone help me with a code to display next to the files in the File list, the date and time each file was created. I have made a form that uses the Drive, Directory, and FileList Controls to display a list of files that are contained in a chosen directory within a selected drive. All other bits are functioning well, except the part that I have mentioned above.
All your contributions will be welcome.
Thank you
Ben
|
|
|
|
|
use the FileInfo method provided in the system.IO class. copy and paste the following code into a new project, test it out, and edit.
edit: oh ya, this is for a console application.
Imports System.IO
Module Module1
Sub Main()
Dim myFileName As String = "C:\file.txt"
Dim myFileInfo As New FileInfo(myFileName)
'print time created on 24 hour scale
Console.WriteLine( _
myFileInfo.CreationTime.Hour _
& ":" _
& myFileInfo.CreationTime.Minute _
& ":" _
& myFileInfo.CreationTime.Second)
'print the date created in YYYY/M/D form
Console.WriteLine( _
myFileInfo.CreationTime.Year _
& "/" _
& myFileInfo.CreationTime.Month _
& "/" _
& myFileInfo.CreationTime.Day)
Console.ReadLine()
End Sub
End Module
------------------------
Jordan.
III
|
|
|
|
|
I am trying to add a border to the bottom of a range in Excel. It is easy to add a border on all four sides using the BordersAround Method, but I can't figure out how to add a border to the bottom of the cell only.
Can any one tell me how to do this?
Thanks!
nvmoss
|
|
|
|
|
Of course, you already know about adding the Excel library as a reference to your project. After that, adding a border should be easy:
Dim xl As New Excel.Application
xl.Workbooks.Open("c:\000\book1.xls")
With xl.Range("Data").Borders(Excel.XlBordersIndex.xlEdgeBottom)
.LineStyle = Excel.XlLineStyle.xlContinuous
.Weight = Excel.XlBorderWeight.xlThin
.ColorIndex = Excel.XlColorIndex.xlColorIndexAutomatic
End With
xl.ActiveWorkbook.Save()
xl.Workbooks.Close()
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Here's the secret to coding Excel with VBA. Use the Macro Recorder.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
Support Bone
It's a weird Life
|
|
|
|
|
Right on, Nick.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
I have some com+ components, part of a legacy application. One of these has been modified to call a new .NET class. I'm trying to debug the .NET application but the call from the COM+ component never goes into the .NET debug environment.
Does anyone have ideas on how I can force the call into the .NET debugger rather than running the compiled .NET component.
Thanks
AJ
|
|
|
|
|
Is there a simple way to convert binary dll files to readable variables?
|
|
|
|
|
Are you talking about reverse engineering someones .DLL?
A question like this from an Anonymous user. I'll stand back and watch to see if anyone bites on this...
RageInTheMachine9532
|
|
|
|
|
Hello,
Does anything know how to determine the hardwar on your machine BEFORE the drivers for that hardware have been installed? I'm using windows 2K and I'm thinking there may be a way to get the hardware IDs through devcon. Is there a better way to do this?
thanks
LP
|
|
|
|
|
can you specify which hardware you want? you can try use the wmi
|
|
|
|
|
I am developing a VB.NET application which dumps data and calculations to Excel. I am trying to write code to add a comment to a cell with the command
EXL.DisplayCommentIndicator = Excel.XlCommentDisplayMode.xlCommentIndicatorOnly
EXL.Range(x).AddComment(comment as text)
No matter how I write the code I always get the following error:
"An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information: Exception from HRESULT: 0x800A03EC."
Can anyone tell me what I am doing wrong?
Thankks!
nvmoss
|
|
|
|
|
Of course, add a reference to the current project to the Excel library. Then, your code should appear something like this:
Dim xl As New Excel.Application
xl.Workbooks.Open("c:\000\book1.xls")
xl.DisplayCommentIndicator = Excel.XlCommentDisplayMode.xlCommentIndicatorOnly
xl.Range("Value1").AddComment("This is a comment")
xl.ActiveWorkbook.Save()
xl.Workbooks.Close()
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Your suggestion doesn't work for me. Here is the code fragment I wrote:
If CtrlP.Text <> "" Then
Dim Com As String
Dim ComRng As String
Com = CType(CtrlP.Text, String)
If IsNothing(lastcell) Then lastcellA = "B11"
EXL.DisplayCommentIndicator = XlCommentDisplayMode.xlCommentIndicatorOnly
ComRng = EXL.Range(lastcellA).Offset(0, 10).Address(rowabsolute:=False, columnabsolute:=False)
EXL.Range(ComRng).AddComment(Com)
End If
Where EXL is the Excel application, lastcell is the last non-empty cell in the spreadsheet range in which I am dumping data, and lastcellA is the address of that cell.
When I execute this code, I get the error message I copies in my original posting.
What am I doing wrong?
Thanks again for your help!
nvmoss
|
|
|
|
|
That's odd, my suggestion works for me; or, at least, it does run.
You should realize that the stuff you're passing to the Address method won't work in VB.NET, those statements only work in Excel macros & VBA.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Boy! I don't know what to do next. I changed computes last week. The new computer was loaded with Excel 2003, rather than the Excel 2002 that I had been using. I built this application onec before I realized that the Excel OM Library upgrade would be an issue. Ever since I switched back to Excel 2002, I have been getting a build error "The IBDE can't be found". It hasn't stopped the build. could this be related to the problem?
As to the Address method, it returns the cell address correctly in VB.NET. Is this likely to cause a problem during run time?
Thanks Again!
nvmoss
|
|
|
|
|
Try adding and removing the reference to the Excel libs from your project. Other than that, I'm tapped out.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
I found a help file on this and thought you would like to know the answer. I had to find the Interop.VBIDE.dll file using windows explorer, then browse to the location in the Add Reference Dialog and add it to the project.
The problem ws the the location had apparantly changes when I switched computers.
Thanks again for your help!
nvmoss
|
|
|
|