The databasa is a .txt file and I need to get it working in a vb.net application. Is there a simple solution?
Thank you in advance!
Printable View
The databasa is a .txt file and I need to get it working in a vb.net application. Is there a simple solution?
Thank you in advance!
Welcome to the forums. :wave:
"Get it working" means what?
What do you need to do with your text file, precisely and specifically?
Thanks for the reply!
First of all I said wrong, It's not a .txt file, its a .dbc which may look similar to this:
-------
NS_ :
NS_DESC_
CM_
BA_DEF_
BA_
VAL_
CAT_DEF_
CAT_
FILTER
BA_DEF_DEF_
EV_DATA_
ENVVAR_DATA_
SGTYPE_
SGTYPE_VAL_
BA_DEF_SGTYPE_
BA_SGTYPE_
SIG_TYPE_REF_
VAL_TABLE_
SIG_GROUP_
SIG_VALTYPE_
SIGTYPE_VALTYPE_
BS_:
BU_:
BO_ 100 Scratch_n_sniff: 2 Vector__XXX
SG_ Temp1 : 0|4@1+ (1,0) [-10|10] "C" Vector__XXX
SG_ Temp2 : 4|4@1+ (1,0) [-10|10] "C" Vector__XXX
SG_ varvtal : 8|8@1+ (1,0) [0|0] "" Vector__XXX
CM_ BO_ 100 "Module which has 2 signals";
CM_ SG_ 100 Temp1 "Tempsignal1";
CM_ SG_ 100 Temp2 "Tempsignal2";
---------
What I need to make is an application which can read and write to this .dbc file.
All help is appreciated!
Before we can do anything, we need to be able to connect to it.
What is a dbc file? What kind of format? How does it get created in the first place?
Outside of a program, how would you open it?
the .dbc file is created by a similar program I'm trying to make. If you open it in notepad it looks like what I posted above. I guess it doesn't necessarily need to be a .dbc-file, but it would still be nice if I got something together that was able to read the old .dbc-files.
To me it simply looks like a regular .txt-file saved as .dbc
If it's just an ASCII text file with a different extension, you should be able to use System.IO.StreamWriter and System.IO.StreamReader to write to and read from(respectively) the file.
Mark is correct.Quote:
Originally Posted by MarkDorf
When I copied what you posted into Notepad, and I saved it as Hack.dbc, the file description that showed up in Explorer said "Microsoft Visual Foxpro Database Container"
When I double click on it, it wants to open the file using Foxpro.
However, when I ran this codeSo, it would appear as though the OS thinks it is a Foxpro file, but your VB.NET program code should be able to manipulate it like any standard text file.VB Code:
'I can write to it the same 'way I write to a standard text file Private Sub Command3_Click() Dim sData As String Dim sFilename As String sFilename = "d:\hack.dbc" Open sFilename For Append As #1 Print #1, "Hack Rules" Close #1 End Sub 'I can open it and load it into a listbox the same way I can any standard 'text file Private Sub Command2_Click() Dim sData As String Dim sFilename As String sFilename = "d:\hack.dbc" Open sFilename For Input As #1 While Not EOF(1) Line Input #1, sData List1.AddItem sData Wend Close #1 End Sub