Click here to Skip to main content
15,883,835 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have a File having 8mb size generating from Indian Remote Sensing Satellite data.
The Name of the file is something like " 0fy23jl.0fm" and having a Extension like .0fm , .0fl , .0fn etc....

Now my Problem is that i can't read the content of that file in Vb.net 2008.
i try all the method of file programing in VB.Net.

but i cant read that particular file only..
using all other file concept i can get read the file only having a extension of ".txt".

Please help me to read this file.

Thank in Advance
Posted
Updated 6-Feb-13 7:03am
v2
Comments
Zoltán Zörgő 6-Feb-13 13:07pm    
Please clarify: file extension does not matter at all form when opening file in vb.net. Please supply relevant code. What is the exact error message you get, while you try to read the file?
Vishal Makwana 6-Feb-13 13:20pm    
No Error Message will occur.
but system get not responding..


my coding is here..

----------


ofd1 = New OpenFileDialog

Dim file_name As String = ""
Dim file_name, file_content As String
Dim i As Int32

ofd1.Filter = "All Supported File |*.txt;*.0fm;*0fl;*0fn"
ofd1.Title = "Browse Files"

Try
If ofd1.ShowDialog = Windows.Forms.DialogResult.OK Then


file_name = ofd1.FileName

Dim fs As New FileStream(file_name, FileMode.Open)
Dim byt(fs.Length - 1) As Byte
fs.Read(byt, 0, byt.Length)
fs.Close()

fs = Nothing

For i = 0 To byt.GetUpperBound(0)
file_name = file_name & Chr(byt(i))
Next


richtext.Text = file_name


End If
Catch ex As Exception


MessageBox.Show("File Not Found" & ex.Message)

End Try

There is no such think as "file extension".

I know that many will disagree. Hold on! In the file name like "?????.ext", neither "ext" nor ".ext" is extension. There was such notion in DOS, but eventually, in newer file systems, such notion was abandoned. Even though Windows Shell treats the part of the name after last '.' in a special way (to indicate "file type"), from the standpoint of the file system, there is no such thing.

Therefore, to open a file, you need to know the file name, period. All of it.

Even if you could do something else, what would be the use. If you have, say, two files which meet certain naming pattern, you still have to tell the system what exactly to use. But is you know the name of the file exactly, "extension" just does not matter. Just use the simple logic.

—SA
 
Share this answer
 
v2
If you are legally entitled to the data in the file, contact the company which has created the files in the first place and ask them for an sdk or something of that nature which will give you access to the file as you want.
The file is likely in a binary file of proprietary serialized objects. Unless you know them and the layout of the file and how to read that, you are pretty much out of luck other than reading the individual bytes.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900