Get A New Word Or Phrase From A Text File?
May 7, 2009
For a project I am doing i need to create a hangman game on visual basic.net. I get given the code and need to make certain changes.
I need to make it: Get a New word or phrase from a text file Be able the user to guess the whole word have some validation so you can only type in spaces and letters using their ASCII values This is what I have done so far but it is asking me to declare "i" when my teacher says we dont have to:
Dim NewPhrase As String
Dim PhraseHasBeenSet As Boolean
Dim PhraseGuessed As Boolean
[Code].....
View 7 Replies
ADVERTISEMENT
Dec 14, 2010
I am trying to make a program which goes through the HTML code of a page and then searches for a certain phrase. I have gotten up to the point of executing a search on a site and then dumping the html code of the body.How would I go about doing this?
The phrase I'm looking for is "<tr><td><a
href=javascript:d(87178)>Name of File</a></td><td>Date Submitted</td><td>Likelyness
to work(%)</td></tr>
All I would need to do is find the number inside of the parenthesis (87178) in this example and I THINK I'm good to roll, so how would I do that?
View 15 Replies
Jun 7, 2011
I have a text file like this[code]...
If I have a form with textboxes or numericalupdowns is there anyway I could change the number of fruit and veg in the text file?
Could it be possible to somehow open the textfile into the form then, edit & save?
View 7 Replies
Jun 21, 2010
I have an assignment that asks me to create an application that lets the user enter a word or phrase, then displays the number of vowels found in that word or phrase.
Here's what I have so far:
Dim mystring As String = Me.txtenter.Text
Dim chars As Char() = mystring.ToCharArray()
Dim newString As System.Text.StringBuilder = New System.Text.StringBuilder()
[Code].....
View 3 Replies
Dec 8, 2011
I'm working on a problem where i have to allow a user to input a word or phrase and then determine if it is a palindrome (a words that reads the same forwards and backwards) . It also says that the program should use a Boolean-valued function procedure named IsPalindrome that returns the value True when the word or phrase is a palindrome and the value False otherwise.
View 3 Replies
Dec 2, 2007
I'm learning to Program in school and i use vb.net 2003. Im trying to create a letter count application that displays the number of times a specific letter occurs in a word o phrase. (uppercase lowercase letters should not be counted) I started out by doing the folllowing:
[Code]...
View 4 Replies
Nov 14, 2009
I'm trying to find a way to have text that would be "Live" as in if a user types an incorrect phrase/letter in a text box, a message will appear prior to a "save" button being pressed. It's pretty much the same as when you're registering on these forums, it checks the availabilty of the username as you type it.
[Code]...
View 12 Replies
Jun 22, 2010
I ran into this assignment that asks me to "create an application that allows the user to enter a word or phrse, then the Label should display that word or phrase backwards in all lowercase. For example, I enter "I read" Then the label should display "daer I" I try to do this with "Substring, Replace, etc", butnone of them work. Is there any particular method to achieve this assignment?
View 6 Replies
Nov 8, 2010
I can search for the word Love in an .rtf file and return every occurance of the word into a RichTextBox. It returns the word and the scripture the word is in, but it also isreturning a bunch of weird text like: archan78988yykp etc etc. How do I onlyreturn the scripture with the searchedword, in this case the searched word is love. The code I am using is as follows:
<
If Line.Contains(Me.rtbSearch.Text) Then
'show search form
[code].....
View 1 Replies
Apr 25, 2009
The following code allows words to be added to a listbox. Add the word to a text file and create a folder with the word as its name. The second part undoes the actions.If I try to delete the word immediately after adding it one of two things happen.
1.An error is reported stating the path cannot be found. Although the listbox index value is correct according to the code the error is pointing at that index +1.
2.The code continues to the point of requesting conformation to delete the folder, still pointing at the index value +1. I the action is confirmed the wrong folder is deleted.
However if I stop debugging, then run the code again all works correctly.Is it likely to persist when the application is compiled?
Imports System.IO
Public Class Form1
Dim pathlist As String = "M:Visual Studio 2008ProjectsEnvironment and Conservation GlossaryEnvironment and Conservation GlossaryGlossary List.txt"
[code]....
View 6 Replies
Apr 20, 2010
Alright. I have a project I need to complete by 11:00 am today. I need a program that will allow a user to input a phrase into a text box. Another text box to input a letter. Then I need the program to count how many times, the letter appears in the phrase. I have everything set up. I know how to count how many characters are in the string, but not how many designated letters there is.
View 5 Replies
Feb 22, 2009
I'm trying to identify if the input of a textbox is non numerical, which cannot be converted to an integer/double for calculation. I do this by converting the input1.text to ascii, and looking at the value to determine the type of input. My question is whether there is any way I can analyze the whole input character by character? Asc() only gives the ascii value of the first character, but what if the input is "9W" etc? Such inputs will pass my character test, but cannot be converted to an integer.
View 2 Replies
Nov 21, 2010
I have a label that is supposed to display a word for 5 seconds and then move down the list in a text file and display the next word.I'm oddly able to make it work in random mode, but not going down the list in order.. random would be ok if used words didn't come up again.
Code:
Dim DurHold As String = My.Computer.FileSystem.ReadAllText(Application.StartupPath & "FlashWords.txt")
Dim DurDelimiters() As String = {vbNewLine}
Dim DurTextLines() As String = DurHold.Split(DurDelimiters, StringSplitOptions.RemoveEmptyEntries)
[code].....
View 2 Replies
Mar 30, 2012
All i want to do is write some text into word... some of the text is normal text the other is bold... how do I achieve this?The samples I have seen, they either do normal text or bold.. but in different lines utilising InsertParagraphAfter()I need to have both in the one lineie how do i do the following line? using vb.net and word automation (word 2010)
View 2 Replies
Sep 10, 2009
I have a file test.txt and inside this file there is a long text.
Inside this file appears very often the words (hello1, hello2 hello ..).
What I want to do is that program gives to me all the "hello" are inside this text file, and I must list them in another text file,
Example : Suppose the file is: "Today is hello1 a beautiful day hello2 and then hello23 I think hello7 I'm going to hello11 ride".[code]...
View 5 Replies
Sep 29, 2010
So I found some code that I am customizing for my needs. So far I get it to browse for a Word file, open that file, and create XML from that document - right now it maps word styles to tags. So, if I had the word "Test" in the document, and it was bold, the output would be <b>Test</b>. Does anyone know of a good function for finding key words in a Word Doc, and then putting that into a tag? For example, if I had:[code]You'll have to excuse my inexperience at this, but I am new to working with accessing certain words in a document and transforming to XML.
View 1 Replies
Mar 1, 2012
I have stored all the elements in a xml file in a text file. I don't want to store all the elements but the distinct values.
View 1 Replies
Sep 2, 2011
I have a problem, this is what I want to do. Let's say I have a text document that contains:
Male = "True"
Female = "False"
I want to make the code search for the line including Female, and then take the word in between the "", so I get false. Then I want to change that to True.
View 2 Replies
Feb 5, 2010
I want my application to be able to read the LINE of the word "Graphic" in it, then load the text as a treeview node.[code]the treeview should add a node called Player then another called Enemy.
View 6 Replies
Nov 11, 2010
Here's some information on how you'd read it. First, you'd read in the file, where inFilename is the path to your text file, using FileStream to access the file, and StreamReader to read the data from the text file:
[Code]...
Next, you'd read the data from the text file into a string array, splitting the array on each new line character. (Each line in the text file is a new member of the array)
[Code]...
Now that you're done reading in the text file, you can close the streamreader and filestream so that the text file isn't still using resources or holding any type of lock(s) on the file
[Code]...
View 1 Replies
Apr 9, 2011
I hav 2 forms the first form has 5 textboxes and second form is only for searching and display the result so I would like a sample code to perform a search in text file for a word but also display the results but all the data is entered from form one
View 1 Replies
Apr 22, 2011
I'm using VB (visual studio) 2008. I'm trying to search a microsoft word file and select/copy text from it What i want to do
a. Search for a string/word in a text document(i.e "question)
b. When its found copy of text from that point to a point further down the document defined by a certain string ("a.")
c. after this is done it will continue to look for the next time the same string occurs (i.e. "question"") and continue as above?
I've figured out how to search for the word (question) but not managed to figure out the rest of it. Heres the code so far
Dim oWord As Word.Application = CreateObject("Word.Application")
Dim wdword As Word.Range
' Create new word document
[code]....
View 1 Replies
Apr 2, 2009
Am working on a project where i have to get the selected text from a word file(Ms word 2007)Please Advice how i can do this.. I have a Created an ADD-IN button in word. I need to get the Selected Text from the Active Word Document and have to store it somewhere for future use.
View 4 Replies
Feb 16, 2009
I have a function read the text file line by line, i have to detect a specific word in the text file befere proceed to another action. But I can't use substring because i not sure exact location of the word.
View 1 Replies
Dec 31, 2010
I have a Word document that has font sizes of 14 and 18, and the document is of 1500 pages.
I have to make specific changes to the font 14 and font 18, and so after searching, I came across VBA for Word that would allow me to do this easily.[code]...
View 2 Replies
May 6, 2009
I wanted to read a spefic word from the text file and if the word exist i wanted to copy the content under that specif word and place it in textbox.For Example My specific word will Top. Under the top it has number like this:12.3.45. So i wanted to coppy that number and place it in text box.I did something to serch for the specic word but it aslways come out false this is my
Private Function IsFileContainsSrting(ByVal SearchWord As String, ByVal FileName As String) As Boolean
Dim FileContents As String = String.Empty
[code].....
View 8 Replies
Apr 22, 2011
I'm using VB (visual studio) 2008. I'm trying to search a microsoft word file and select/copy text from itWhat i want to doa. Search for a string/word in a text document(i.e "question)b. When its found copy of text from that point to a point further down the document defined by a certain string ("a.")c. after this is done it will continue to look for the next time the same string occurs (i.e. "question"") and continue as aboveThis is to search a question paper and separate the questions out and save it separately .
View 1 Replies
Jan 29, 2011
How can I open a text file, find a certain word in the text file, and then, just before that word, write a line of text to the file - then save the file?
View 4 Replies
May 13, 2009
how to access the text file that I added to the project as a resource file. I want a list of words to be part of the .exe file, not contained in a separate .txt file on the hard drive.What do I need to change?
vbcode
Dim reader1 As New System.IO.StreamReader("c:1.txt")
For i As Integer = 0 To 25
BlanksOne(i) = reader1.ReadLine()
Next i
View 9 Replies
Nov 26, 2007
Am writing a windows app using vb.net 2005. The app captures a string variable from the user. As each file within a directory is read, I want to match the stored string within each file. If I find a match to the string, I want a list box to be populated with the name of the file. I have added Imports System.Text.RegularExpressions and tried using the match collection.
For example: My direcotry has 5 text files. I want to match a string "PARENT" in the text of all these 5 files. The list box should output the name of each file where the string was found.
View 2 Replies