Need a function that will return certain system information into a text box.
Logged into Domain (Yes or No) If Yes then the Domain Name
Logged into Workgroup (Yes or No) If Yes then the Workgroup Name
Any Service packs installed?
Listing of Mapped Drives
I am in the process of moving VB code to C#. However, I have encountered a stumbling block. I have the following code in VB below that uses the Scripting.FileSystemObject and the Scripting.File object. How would I program this property below in C#? Would I use the System.IO.File in place of the Scripting.File object? If so, what would I use for the Scripting.FileSystemObject? Would I open a filestream? If I do, FileSystemObject grabs the whole file, how do I do that using filestreams?
Private mvarFSO As Scripting.FileSystemObject
Private mvarLocalFile As Scripting.File
Public Property Get LocalFile() As Scripting.File
Set mvarLocalFile = Nothing
If mvarFSO.FileExists(mvarMyVSSItem.LocalSpec) Then
Set mvarLocalFile = mvarFSO.GetFile(mvarMyVSSItem.LocalSpec)
Set LocalFile = mvarLocalFile
You can still use the Scripting.FileSystemObject in C# if you would like. The code would be pretty close to what you have already, just change it to use the new syntax. Very quick and easy.
You can also use the IO libraries provided by .NET but you will, obviously, have to re-do all the code that calls this property. Off the top of my head, I can't really tell you what needs to change but I would probably stick with the Scripting.FileSystemObject if you're porting. It's usually easier to change as little as possible and make sure it's working before moving on.
How do you scroll a window in .net? I want to make a RichTextBox scroll to a certain position, without using ScrollToCaret(). I tried using the user32 SetScrollPosition, but that just moves the scroll bar itself. In other words, the scrollbar moves, but the window doesn't scroll.
Is there a ClippingRect object in C#? I can't find it in the Control class..
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
Have somebody seen CodePageEncoding class in the .NET documentation, or in the library? Where it is, or has it been thrown away from the final release?
I really wander whether somebody is using it. This class is referenced in Dr. GUI .NET article #5 (from May 31, 2002 - quite fresh issue). According this article, the CodePageEncoding should be in System.Text namespaces.
However, I'm not able to find it in my libraries. I cannot find it even in the documentation accompanied with VS.NET, as if this class never existed...