Wrox Programmer Forums
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 13th, 2004, 08:46 PM
Friend of Wrox
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to open Binary .dat file?

How do you open and display a BINARY .dat file in VB.NET.

Of course when I tried to open it in Notepad, I got weird characters.

"arm01Props Severed arm‡  bl01FX Black lightà  cat01Props Deranged catÏ  cool01Masks
Cool GhoulW  fog01FX Fog machine«
             fogj01FX Fog juiceç  "

I don't know what is in the .dat file.
I don't know what kind of binary this is.

This xx.dat file is used by a sample VB.NET code to pull data from it to display Dropdownlist.

That is why I wanted to open it to see what filestream I am working with in VS.NET.

Can someone give me some code?

Old June 14th, 2004, 11:59 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts

You need to provide more information.- what are you trying to display? the 1 and 0's? the data as ascii? what?

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
Old June 16th, 2004, 09:56 AM
Registered User
Join Date: Aug 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to weichunglow

before that you need to imports System.IO
you can try the code listed below:

Dim fs as FileStream("file.dat", FileMode.Open)
Dim r as BinaryReader(fs)

wei chung

Similar Threads
Thread Thread Starter Forum Replies Last Post
DAT File Extension open in DotNet Framework bala2 General .NET 0 August 27th, 2007 08:30 AM
Edit .Dat file Mpriya VB How-To 2 May 22nd, 2007 08:43 AM
code for decoding a binary dat file myth.12887 C++ Programming 2 May 18th, 2007 09:40 PM
Open .dat and saveas .txt tready Access VBA 6 March 10th, 2006 09:51 PM
Why user download word file is binary when open Andraw Classic ASP Basics 5 January 17th, 2005 12:41 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.