Results 1 to 8 of 8

Thread: Serialization - random files

  1. #1

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Serialization - random files

    How do you read/write random access binary files in .Net?

    Code snippets would be cool.
    I don't live here any more.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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.

  3. #3

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    Originally posted by Edneeis
    use the Compatibility namespace and do it the same as in VB6
    How would I code that? (the namespace part not the VB6 code)
    I don't live here any more.

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Run your VB6 code through the Upgrade Wizard.

  5. #5
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    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
    tried this:
    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         ListBox1.Items.Clear()
    3.  
    4.         Dim p() As Process = Process.GetProcesses()
    5.  
    6.         Dim i As Integer
    7.         For i = 0 To p.GetUpperBound(0)
    8.             If Not p(i).MainWindowHandle.ToInt32 = 0 Then
    9.                 ListBox1.Items.Add(p(i).MainWindowTitle)
    10.             End If
    11.         Next
    12.     End Sub
    and it seems like it doesnt get all the windows hehe....
    Last edited by MrPolite; Apr 5th, 2004 at 11:11 PM.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  6. #6

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    Great!

    That's close enough to fool the boss!
    I don't live here any more.

  7. #7
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by wossname
    Great!

    That's close enough to fool the boss!
    aah poor boss I think that didnt' work for windows explorer windows and such
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  8. #8

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    Looks like we got our threads crossed!
    I don't live here any more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width