VS 2010 Make A Simple Program That Can Create A Text File With The Content?

Aug 23, 2011

Im learning Visual Basic 2010 on my programming class and we reached the part of file handling. Here i tried to make a simple program that can create a text file with the content of what i type on the textbox, basically i create the file if it doesn't exist, and if it already exists i append the content to it. Once the file is saved i can read it using the "Open" button. Unfortunataly, whenever i try to create the file, the compiler gives me an error saying that it cannot modify a closed file, although i've followed up the execution instruction by instruction and i can't find the error.

Imports System.IO
Public Class Form1
Dim body As String

[code]....

View 6 Replies


ADVERTISEMENT

VS 2010 - Make A Simple Text Based Rpg Game?

Nov 9, 2011

[code]...

Yup,not PHP but it's the same for readability)As you may imagine I want to make a simple text based rpg game, but that's not an important fact.The buttons btn1 to btn3 are already created at the designer, and there are going to be other procedures which will assign values to their text property according to the game context (main menu, combat, shopping, training, etc.) you're at.Ok, so what I want to do with that procedure I pasted is to parse the text of ANY of those buttons when I click them, and according to its value select a case which will trigger another appropriate procedure (now there are only msgboxes as placeholders for testing only).My problem is that I dont know how to refer to the originating class of the handled event! I mean, let's say I click btn2. I'll want to immediately get the text property of that button only and use it as the value for the select case tree. I suppose I need to put something at that ?I wrote there, but I don't have any idea. The first time I was so naive to put me.text in there, and of course it returned the form name. Is there's something to do this thing...? I thought at first it would be a very simple task, but I'm going nuts searching for a solution so it's like if it was not possible, but I find hard to believe that, because this would be very useful, right? By the way, what I want to achieve is not needing to make a separate procedure for each button and to avoid as well the need to move any game option to another procedure if later on I want to rearrange the menus, because I expect the game to have more than three buttons actually.

View 2 Replies

VS 2008 - Simple Text -> Xml Program - Save The Contents Of The Bottom Text Window To An Xml File

Dec 23, 2009

I have this Quiz software that lets you create online multiple choice quizzes which are great for studying (I am in grad school and I'm trying to use everything I can to learn). So the Quiz software is great but it only lets you input questions by hand, one by one. I took a look at the .xml file that the quiz program spits out and came up with the idea to try and make a converter so that I can import many questions at once. I was hoping to try and solve this limitation by doing the following:

Take a .doc that say a tutor gives us with a bunch of practice questions, and then take that into Crimson Editor, and then format it so the question is on line 1, the multiple choice answers are on lines 3,4,5, and 6, (for the next question, the question would be on line 11, and the answers on lines 13, 14, 15, and 16, and so on) and then take that saved .txt file into my program, hit the generate button, and it will spit out the .xml file, and then import that into the quiz software to generate the online quiz.

Here is an attached screenshot of my program layout so far:

I figured out how to open a text file by watching simple youtube tutorials, but I don't know how to have it generate the stuff and have it show up in the bottom text box. I know how to do the coding to convert the txt to proper xml code but I don't know how to be able to save the contents of the bottom text window to an xml file.

View 1 Replies

Create A Simple Program With 1 Text Field, 1 Button, And An Area To Display What Is Happening And If There Were Any Errors?

Mar 23, 2010

I'm looking to create a simple program with 1 text field, 1 button, and an area to display what is happening and if there were any errors.My goal is to be able to delete user profiles stored on a network drive by simply putting in the users ID and hitting the button.I'll use my own id as an example:If I put mdesieno in the txt box and hit the button, I'll need the button to map to the network drive and delete mdesieno.corp and mdesieno.v2 I would like the bottom half of the window to display text like:

"Deleting User Profile mdesieno.corp" SUCCESSFUL
"Deleting User profile mdesieno.V2" SUCCESSFUL

To me this seems pretty simple, but as I said, I do not know VB yet. Is there code out there that is already written to do something like this?

View 11 Replies

VS 2010 Create A Program That Can Access Information Held In An Excel Database And Show It In A Simple Form

Feb 27, 2012

how to create a program that can access information held in an excel database and show it in a simple form.

View 2 Replies

Making A Simple Program That Encrypts A Text File And Then Decrypts It?

Sep 30, 2009

I am making a simple program that encrypts a text file and then decrypts it: why i get an error when i use this

Public Class Form1
Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
System.IO.File.Encrypt(TextBox1.Text)

[Code].....

View 12 Replies

VB 2010 Express - Create A Simple Local Data File On PC Using Mysql

Jul 15, 2010

I have been reading about ADO, SQL, datasets, data adapters etc and have gone into information overload. My next step is to create a simple data file of my own that I can manipulate, update, sort etc in VB Express. Do I need another piece of software? I read about MySQL, which I understand is primarily used to access databases on the net, but can that be used to create a simple local data file on my PC? Can you simply hard code something in VB Express?

View 6 Replies

VS 2010 Reading Text File And Saving Content?

Aug 18, 2011

I am trying to create a console application that allows me to read the contents of a text file and saving the data by specific name in a set of files. For example, the text file I am going to read is a tab delimited file. Some content of the file includes full name, school, location, and whatnot. I want to save the content by school name in a set of files that have the school names. In this case, everyone that attends "Central" will be saved in a file named Central.txt.Everyone that attends "Central Park" will be saved in a file named Central Park.txt.These are the sub procedures I came up with so far:

Readfile()
'Use StreamReader
WriteFile()

And I think I am on the right track of reading the text file:

Dim objStreamReader As StreamReader
Dim strLine As String
'Pass the file path and the file name to the StreamReader constructor.

[code]....

View 2 Replies

VS 2010 - File Saving - Simple Pseudo-encryption Program That Changes Each Character Into Another

Apr 22, 2011

I recently made a simple pseudo-encryption program that changes each character into another. It is capable of encrypting and decrypting a string. This can also be done to any text file as well. The characters range from ASCII 32-254 (This on it's own may be an issue because of #127 being DEL).

Because I believed my own coding may be at fault, I attempted this with Triple Des with identical results.For Triple Des, the requirements for en/decryption was:

Encrypt: String to Byte
Decrypt: Byte to String

And to change them either direction, I used UTF8. I also attempted ASCII and UTF32, but I don't know what I should do. I am considering dropping this but I want to learn problems like this because I am currently in college and haven't started my core classes for programming yet and want the head start.

The point where I have come into a problem is attempting to do this to another file type like an image. I looked at the results from encrypting then decrypting and the results were similar, but it seems file encoding must be the culprit.

View 3 Replies

VS 2010 Make A Program In Which If The Textbox Text And The Listbox Text Are The Same Order?

Apr 25, 2012

im trying to make a program in which if the textbox text and the listbox text are the same order, which they are in the picture, a bluie fonted text saying well done appears. However only the red text appears which is only meant to come when the order of the text in both listbox and textbox isnt the same.

Here is the code that i used for this:

listarrays = name of listbox
textbox1 = name of textbox

l is the name of the label for correct answer(blue font)label3 is name of label with red font which should only appear for wrong answer

Dim text As String = Me.TextBox1.Text
For Each item As Object In listarrays.Items
If item.ToString = Me.TextBox1.Text Then

[code].....

use another textbox instead of the listbox but thats just making itmuch harder for me as I already made the full code working with the listbox. My lecturer told me i need to convert both in string so both textbox and listbox are compatible and i did so (see code above) but the correct label doesn't show?

View 17 Replies

Create A Program With A Simple Gui?

Jan 4, 2012

Im trying to create a program with a simple gui that enables me to search for and select parent folders containing child folders containing multiple files and then validate those files based off of constants i set per child folder and file.

Example

User selects Parent FolderX
Parent FolderX > (ChildFolder1 ( Constant for ChildFolder1 says open file 4 ) > File 4

Compare multiple strings of text in a specific order based off of file name to constants i have set for that named file Then continue to ChildFolder2 ( Constant for ChildFolder2 says open file 16 ) > File 16 Compare multiple strings of text in a specific order based off of file name to constants i have set for that named file If there is any constants not read in one of the files after all have been checked, return msgbox with a notification and write .txt log with child folder and file names to specified directory?

View 4 Replies

How To Make Simple Program

Jul 2, 2009

i want to make a simple program that can be used of add,delete,edit,save,, thats all, so that i will understand the basic of programing.so that in that program i will developed it and also connection of vb2005 to sql server 2005.. i am amateur here using this vb2005 and sql server 2005.

View 4 Replies

Design A Program That Can Encrypt And Decrypt Messages Stored In Simple Text Files Using A Private Key Stored In A Separate File?

Jun 13, 2011

Need to design a program that can encrypt and decrypt messages stored in simple text files using a private key stored in a separate file. Software should also be able to allow the users to enter simple messages that either displays the encrypted or decrypted message. The encryption method should use a simple substitution method. It should be set out in the following format:

Example (the "@" is the separator):

@
The character The Code End of line
A @ 4gh EOL
B @ 84!9 EOL

Has to use the 256 ASCII character codes. The separator will be used to separate the character and its corresponding code.Here are the pseudocodes I have come up with:

� Read any private key file
separator = readline(file);
while not EOF(file) do
tempStr = readline(file);

[code].....

View 5 Replies

Create A Simple DVD Player With Program?

Apr 26, 2012

I am trying to create a simple DVD Player with Visual Basic 2008 (Express). But I am trying to find this item for the Toolbox-"MSWebDVD".

Does anybody have, like a download link to get it for VB 2008? If you do provide me with a download link, then I would kindly ask to tell me on how to apply it.

View 3 Replies

Create A Simple Shortcut To A Specified Program?

Mar 5, 2012

I would like to create a simply shortcut to a specified program. All of the codes I've tried use the WshRunTime library and it seem to throw an exception every time.

View 3 Replies

Make A Simple Program Shell?

May 4, 2009

I'm trying to make a per-user shell for a Vista box to simplify use of a particular system for my users. I have no problem making a program that I want to use and I am familiar with the process of editin the registry to make my program the users shell but I've run into a snag.

Whenever a user with the custom shell logs on, there is a delay just after they enter their password where the system will sit at "Preparing Desktop" for about 30 seconds. I know for a fact that the user desktop is already made and this shouldn't be taking that long.

I've poked around on the web and see various places saying that winlogon is waiting for the shell to flag a "shell ready" flag of some sort but I am unfamiliar with any such flag.

Anyone know of such a fix for the long login time or anything about a shell ready flag?

View 10 Replies

How To Make A Simple Folder Locking Program

Jul 27, 2009

how to make a simple folder locking program and sorry don't have any code for it.

View 2 Replies

VS 2010 Create PDF With Dynamic Content?

Jan 20, 2012

I'm looking for a way to create PDF with dynamic content. When you google for it, you get 1000 hits on how to dynamicly create PDF's, but thats not what I mean.

View 6 Replies

How To Create A Simple Program That Monitors What Programs Are Opening

Nov 10, 2010

I am wanting to create a simple program that monitors what programs are opening and if necessary close one or two. I would also like to know if it is possible to get the window title (using a simple function/sub) and check with a stored list of programs,

whether that particular program is allowed to be open and if so before the program can be opened a password dialog will appear asking the user to enter the defined password in order to continue opening the program. Is this possible? Also should the password entered not match up, the program/process will not be allowed to open and will be closed/cancelled.

some code or point to the part of the microsoft site that has information on getting window titles and how to close current programs open etc

View 5 Replies

Create And Append Text To Txt File In Program?

Oct 23, 2009

I am trying to create a textfile if it doesn't exist or append text to it if exists in vb.net.

For some reason, though it is creating the text file I am getting error saying process cannot access file.

And when I run the program it is writing text but how can I make it write in new line.

Dim strFile As String = "C:ErrorLog_" & DateTime.Today.ToString("dd-MMM-yyyy") & ".txt"[code]...

View 5 Replies

VS 2005 : Make Program To Select A File, Create DataTables And Then Perform Some Other Functions?

Feb 9, 2011

I am attempting to have my program select a file, create DataTables and then perform some other functions. I want to be able to open another file and re-do the same steps.The problem I am having is that I add columns to my Datatables and when I try and to open another file while one is already open I get a message that a column of xyz is already added how do I properly "clear my datatable" or perhaps that isnt even the correct approach? Here is the code I have that Opens a File

HTML
Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click

[code]....

This was working at one time but after adding to my project I must have placed something in the wrong place inadvertantly or it has soemthing to do with adding columns,?

View 4 Replies

Make A Simple Program That Detects If A Game Closes?

Feb 10, 2011

I'm trying to make a simple program that detects if a game closes, and when it does, it shuts down the computer.

View 1 Replies

Make A Simple Program That When For Eg A User Enters 4 It Gives This Figure ****?

Mar 1, 2009

i was wondering how i can make a simple program that when for eg a user enters 4 it gives this figure **** and so i want that if the user enters 5 it gives ***** etc.

View 9 Replies

Make A Very Simple Asynchronous Method Call In Program?

May 1, 2012

I just have a simple vb.net website that need to call a Sub that performs a very long task that works with syncing up some directories in the filesystem (details not important).

When I call the method, it eventually times out on the website waiting for the sub routine to complete. However, even though the website times out, the routine eventually completes it's task and all the directories end up as they should.

I want to just prevent the timeout so I'd like to just call the Sub asynchronously. I do not need (or even want) and callback/confirmation that it ran successfully.[code]...

View 2 Replies

Make A Very Simple Program That Connects To A MySQL Database Using .NET?

Feb 27, 2011

I am trying to make a very simple program that connects to a MySQL database using VB.NET. My program only has one form and one label. I setup my MySQL database to have a table and one field (a VARCHAR)called "Tab1". I manually inserted the value "CLOSED" into the Tab1 field using PHPMyAdmin. I want my program to change the value of the field to OPEN/CLOSED and I also want the label text on my form to change too when it's clicked.

[Code]...

View 3 Replies

Make Some Simple Program For Encrypt / Decrypting Message Using VB?

Jun 29, 2010

i want to make some simple program for encrypt / decrypting message using VB, my problem was when i want to decrypt the message, the result was incorrect,

Code:
Dim decryptor As Integer = TextBoxhasilencrypt.Text
Dim privatekey As Integer = Labelprivatekey.Text
Dim modulus As Integer = LabelModulus.Text

[code]....

the logic error on the program was when the "power of" are odd

View 2 Replies

VS 2005 Make A Simple Client-server Program?

Sep 27, 2010

I was wanting to make a simple client-server program.I saw some code for it and it was easy to understand but it was with winsock.

The program is:

Client: Clicks button.
Server: Recieves Text written in clients textbox.

Is there a reasonably easy way to do this?Maybe Net.Sockets or something similar?

View 3 Replies

Forms :: Make The Program Detect When The User Copies New Content To The Clipboard?

Sep 25, 2011

application i'm developing in school.I am trying to make the program detect when the user copies new content to the clipboard,when this happens I want the program to check the data type,

I want text content to be written to a text file.Images can be left alone.if a file or folder is copied, i want the location of the copied file and the file name to be written to a text file.

I only really need help in getting the program to detect a clipboard modification, preferably with the AddHandler statement.

View 2 Replies

Use The DataTable.WriteXml Method To Create An XML File Without Erasing Previous Content In That File?

Feb 18, 2011

I have to generate an XML file from several database tables. I could use the WriteXml method of the DataSet to do it, but the database tables are really huge and I can't add all those tables in the DataSet at the same time or it may cause a problem because of the big amount of memory used. Then I decided to use the DataTable's WriteXml method and save table after table, but the the generated file only stores the information of the last DataTable.WriteXml's call. How can I preserve the previous XML data when adding all that information?

View 4 Replies

Create A Simple Program That Send String Data Through Winsock

Sep 3, 2010

im trying to create a simple program that send string data through winsock, there are hundresd of tutorials allover the web, but non of them seem to work! I am fairly new to visual basics but i undersatnd the consept of winsock and 'all that stuff'. [code]

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved