Save An Array To File?
Aug 1, 2011I have a two dimensional array as string and I what to save it to a file, what should I do?
View 1 RepliesI have a two dimensional array as string and I what to save it to a file, what should I do?
View 1 RepliesCan I save an array into my .bin file then read the array again just like a string or Integer??
View 2 RepliesI have a string array that is populated with thousands of entries. I am wanting the quickest way to save this data to disk and to also load it back up.
Currently I am looping through the array and appending this data to a string and then saving this string. This takes a long time.
What is the fastest/most efficient way to do this?
I am using visual studio 8. vb.net.I have an array, array1(100,8) and I want to save it as a csv file so that I can open it in excel and examine the contents more closely. The feature, of saving as a csv file, is not going to form an integral part of the finished vb app, I just need something quick and dirty because the data in the array just requires looking at in excel so that I can fully understand its significance and thus continue coding my app.
View 2 RepliesI am writing a program in VB10 and the programs purpose is to read an encrypted text file and decrypt it into a textbox onscreen. You can then save the text.The problem is that it keeps saving text in files like this:
H
e
l
l
o
I cant figure it out. Here is my save array code:
First the savefiledialog
Sub SaveFileDialog()
Dim strFileName
[code]....
I need to save array into excel file. I'm using code taken from [URL]
Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object
[Code]....
But i want to let users to choose folder and filename themselves instead of determining location and filename like in those code above oBook.SaveAs(sSampleFolder & "Book2.xls") I wonder if i can use SaveFileDialog but i dont know how to do it. Or is there any other way to do this?
My homework task is to add data to an array of records and then save this to a file.
I'm having problem saving to a text file. I have the following code:
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim SW As New StreamWriter("Records.dat", False)
[Code].....
In my test example here I realise that the reason I have 4 lines written is because I have 4 elements to the array, but why am I getting this gobbledegook instead of records with a name and age?
I know I have added the data correctly to the structure because I can redisplay it elsewhere on my form. I just don't get how to save data in a structure to a text file.
My task requires use of an array and/or array of records, a text file
Private Sub LoadButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadButton.Click
View 3 RepliesI have this code which saves an "Image" to a SQL Server database:
vb.net
'You have the images in the PictureBoxes, now you need to store it as a Reference Image
'if the user has selected that option
Dim ms2 As New MemoryStream()
[Code].....
I am working on a PHP site at the moment that is having trouble reading that data to display the image, so I am attempting to not only save it to the DB, but also save it as a bitmap or other file type to the actual server.
How can I create an image file (not really picky on which file type) from the "arrImage()" data above?
I have a device with upon serial communication, it send the data as HEX values, (e.g., C020042ABD0F91A103E400F929EBC). I use the following code to get data from the serial port.
Dim fStream As New FileStream(sFileName, FileMode.CreateNew) ' creates new file
Dim bw As New BinaryWriter(fStream)
System.Threading.Thread.Sleep(1500)
ComTd.Read(data, 1, bCount)
Dim bCount As Integer = 4119 ' it is the size of the chunk not block size
Dim data(bCount) As Byte
[Code] .....
I want to compare two array and save the miss match character into 3rd array.
View 1 RepliesI am trying to find a way to allow my users to choose the directory to save files into, THe file name is automatically generated as it has a naming convention and i am able to pre program a location to save to but i d like to be able to allow my users to decide themselves which directory they want to save the files to and to have the ability to choose which directory to save to
[Code]...
i have made a downloader . i use save file dialog to save file but when open save file dialog it does not get the file name and file extension from the source....please help me to make a file downloader which gets the file name and extension automatically from web. my downloader downloads file succesfully but doesn't show its real extension and file loses its default extension.
View 1 Replieshere's my nut for the day.. i want to save a file to a folder. here is the code i have:
[Code]...
im trying to create a text file with some details that ive put into some text boxes.I got on screen
3 textboxes
2 buttons (which i would like to get their text from)and then 1 button to save details and exit.I got the coding place but i dont want a a dialogue box to come up i just want to save the stuf to a set folder location, will need to read the textfile to the same area, incase the user wants to change the data. Struggling to understand the my stream section in my books.
Dim saveFileDialog1 As New SaveFileDialog()
saveFileDialog1.Filter =
"txt files (*.txt)|*.txt|All files (*.*)|*.*"[code]......
i am coding a sound recorder with VB2010, how to save/export the object file to .WAV file with save button?
Public Class SoundRecorder
Dim soundrecord As Object
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA"
[Code].....
Dim sw
As StreamWriter
Dim flagX
As
Boolean
[code]....
I am attempting to write a playlist for my media player which is already built. I have found a way to build a playlist for it but it would be helpful if I could save the contents of TextBox1 to a text file without using the save as. I am trying to get over a user inputting a file name for the finished text file so is it possible to write the file c: est.txt without using the save as dialog? I have found that I can use a vbs program file which creates a playlist in a folder. I save the vbs file text to the textbox then save it as a vbs file in the playlist directory, then execute the finished file to make the playlist.
View 5 RepliesI have researched the net, youtube, and the msdn DB, and still can not find the working answer I am looking for. I would like someone to show me how you would save the contents of "Listbox1" to a .txt file using the "Save As" Option. I know how to hardcode a savepoint in, but since there will be multiple users I would like the option to be up to the end-user.
View 4 RepliesIm trying to save a file in XML and offer the user a save dialog to appear so they can name the file. The file will save using a custom file extention. The problem is I keep getting off the wall suggestions and Im looking for a simple solution. Here is what I have, please only show examples using my syntax based code. Im still a bit new to Vb so posting off the wall examples
[Code]...
i made a vitual dekstop and i have a few problems that to be fixed. The first problem i have is that i have a picturebox as the entire form like the desktop background but the progrblem is that i have some group boxes over that picturebox box. How can i make so you can see throw the group box so that you can see the image behind it. And how can i save a picturebox image without a save file dialog
View 5 RepliesMy question is simple (the answer may not be...), What I am looking for is a way to save a file as an encrypted file (so know one can open it except in visual basic or a way to save it with a unique ending that only visual basic will recognize. I will also need to know of a way to open or load the file to.
This is going to be used in a game I am working on (and yes...I know visual basic isn't really meant for games, but it is coming together pretty well). I was originally going to have it save as a text file, but then everyone could open, read it and even change there stats. That is what this file will contain, the stats for their character, and when they load it, it will place the values into the correct spot.
I am a partial beginner or intermediate coder, I can understand code, I just don't know all there is, like saving and loading, and this is probably a little harder.
I have a 2d-array but the array is made of a class and I want to know what is the best way to save this array so I can edit and bring it back up and save it back when needed.
So I have this class
Friend Class CellValue
Public CellColor As Color = Color.White
Public CellShape As Shape = Shape.Blank
Public CellName As String = ""
Public CellLocX As String = ""
Public CellLocY As String = ""
End Class
[Code] .....
I have a website written in .net 4. I'd like to include a save button on one the pages that will save the webpage as a mht file. This way the user can save the page as a mht file type on his/her desktop without have to use the browser toolbar.
I'm currently working with the following code but I need to modify it so it to capture the url of the current page the user is viewing verses hard coding the url into the button click event.
Partial Class Form1
Inherits System.Web.UI.Page
End Class
[Code].....
I have a website written in .net 4. I'd like to include a save button on one the pages that will save the webpage as a mht file. This way the user can save the page as a mht file type on his/her desktop without have to use the browser toolbar. I'm currently working with the following code but I need to modify it so it to capture the url of the current page the user is viewing verses hard coding the url into the button click event.
Partial Class Form1
Inherits System.Web.UI.Page
End Class
I am trying to save a file as a jpeg. So far the save dialog box opens and it seems to save but I can't open the saved file to see it.
[Code]...
I am on the last stage of my web automation form for my business and now all it wants me to do is click "Run, Save or cancel" in the normal IE download file popup. The first problem is if i click save (the option i want to do) the form crashes. The error i get is: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
[Code]...
Apparently the system.collection.arraylist does not work since it is more of a list than anything else. Is there some sort of collection that will save my array as is so that it can be retained latter on application load?
View 5 RepliesI have 2 Structures
Public Structure One
Public ItemOne As String
Public ItemTwo As Integer
End Structure
[Code]...
Results In an Unhandled exception. Bad Record Length. and then If I close it and reopen it I get an 'Unable to read beyond end of stream' error. So what is the best way to save an array of structures? Binary Reader/Writer? and why does this way not work (Even if its derived from VB6)
I have Dim a(15) as integer i wont to save this array in Viewstate .
View 2 Replies