How do you read/write random access binary files in .Net?
Code snippets would be cool.
Printable View
How do you read/write random access binary files in .Net?
Code snippets would be cool.
You would have to use the Compatibility namespace and do it the same as in VB6 or write a custom serializer for that. Otherwise you'd just serialize a collection of objects and deserialize the whole collection back to use it.
How would I code that? (the namespace part not the VB6 code)Quote:
Originally posted by Edneeis
use the Compatibility namespace and do it the same as in VB6
Run your VB6 code through the Upgrade Wizard.
try this, unsure if it would give you correct results, but it should work...
Try getting a list of all processes : Process.GetProcesses()
Loop through all of them and check their MainWindowHandle and MainWindowTitle property. I think when there is no window, the window handle would be zero. If it's not zero, then you can just get the title of the window using the other property I just mensioned.
edit:
hmmp, maybe not:D
tried this:
and it seems like it doesnt get all the windows hehe....VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ListBox1.Items.Clear() Dim p() As Process = Process.GetProcesses() Dim i As Integer For i = 0 To p.GetUpperBound(0) If Not p(i).MainWindowHandle.ToInt32 = 0 Then ListBox1.Items.Add(p(i).MainWindowTitle) End If Next End Sub
Great!
That's close enough to fool the boss!
aah poor boss:D I think that didnt' work for windows explorer windows and such :(Quote:
Originally posted by wossname
Great!
That's close enough to fool the boss!
Looks like we got our threads crossed! :)