Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0 VB8.0 C# VB.NET
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 6-Feb-13 8:02am
Edited 6-Feb-13 8:03am
v2
Comments
Zoltán Zörgő at 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 at 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
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 277
1 Maciej Los 220
2 DamithSL 190
3 Raul Iloc 185
4 Richard MacCutchan 175
0 OriginalGriff 5,130
1 DamithSL 4,197
2 Maciej Los 3,670
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,821


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 6 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100