Ignoring Lines Containing Certain Numbers (Code Included)?
Dec 3, 2009
Basically I want to have a lines that contain certain numbers ignored. Where lines that do not contain those certain numbers show up in textbox1.text.For Instance.In the code I want it to ignore all lines that contain "1234" and "1645" when it reads Accessed.txt, and output every line that does not contain those numbers. So if a line contains "78910" it would output that line into textbox1.text.Here is what I have so far, and it works as long as I only have 1 if not contains statement. When I have more than one, it doesn't work at all and just outputs everything in the text file.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
Dim r As New System.IO.StreamReader("S:accessed.txt")
[code].....
View 5 Replies
ADVERTISEMENT
Jul 18, 2012
I am trying to create an applicaiton that will verify that a large text file used far a CNC machince
has all of the operations in order (someone may have edited the file by mistake) I wish to bubble
sort the lines of the file while ignroing other lines. I really stuck on how to set up and handle
this program. Here is what I have thus far (just started).[code...]
View 17 Replies
May 18, 2010
I have an array of integers (5 x 5). Is it possible for an index to have a a list of numbers?For example, Row3, Column 4 has 10, 4 52,10 Array (3,4) = 10,4,52,10
View 4 Replies
Sep 3, 2009
how to count the lines in textbox1.text (with multiplelines). I don't need to count each character. I only need to count each line from top to bottom in textbox1.text (multiplelines) and I will use Label1 to display the numbers.
example:
1-pauljaones
2-tommyperrry
3-marktoms
4-Jonessmith
5-paulwhite
Obviously this is 5 lines and that's what I need to count.
View 12 Replies
Nov 4, 2011
What is the code for ignoring the case of an entry while checking to see if the entry is correct or not... (i.e. in a flashcard program... given definition, asks for the name) I don't want the case of a character to affect whether the answer is correct or not.
View 2 Replies
Aug 22, 2010
I know this has been answered but I can't find it. Somehow the line Numbers have been disabled on me Can someone list the steps to show them in the code window?
View 2 Replies
Feb 24, 2010
Im just trying to get a simple multi line label box counting numbers using vbCrLf.
Dim startNumber As Integer
For startNumber = 1 To 4
lblCount.text = "Number = " & startNumber & vbCrLf
Next startNumber
I just want something to display like this in a multi line label, not a textbox:
Number = 1
Number = 2
Number = 3
Number = 4
But... I keep getting something like:
Number = 4
I already turned auto size off and expanded the label.
View 7 Replies
Jul 29, 2009
Working with Timers, SMTP Client, and Screen Capturing abilities for VB.NET, "SIMPLE". I'm working on an application that takes a picture of your desktop, saves that image to the C: Drive, ie C:Test.jpg, and then Sends a Message to a cell phone XXX XXX XXXX@MyBoostMobile.com, and uses the Captured image, ie, Test.jpg as it's attachment. 1024 x 768,
[code]...
View 3 Replies
Jul 1, 2009
How to comment multiple lines of code/block of code in VB?
View 5 Replies
Jul 26, 2011
I have the following code, my employer wants me to reduce the lines of code to do the job.
Private Function getClientSheetNames(Optional ByVal type As String = "all") As List(Of String)
If type = "extra" Then
Return clientExtraSheetNames
End If
[code].....
I am not able to make out how can I cut the lines and have the same functionality !Are there any vb.net construct that can reduce the loc by better implementation ?Can I have a new function to be called from getClientSheetNames and getDevSheetNames that will can implement code resue ?Can I introduce polymorphism in a possible new function ?
View 1 Replies
Mar 8, 2011
Seems begineer but i really do not understand what these lines of code saying, since I'm kinda like newbie in datatable and dataview or such stuff! [code]).DefaultView.Count = 0 Then EncodeToText will encoed the text given from DESCRIPTION field in the database and convert it to string. So it is filtering it but only certain description fields, how ever by some strange reasons that second line is not working properly.
View 1 Replies
Mar 23, 2011
Basically I'm trying convert the following....
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
[code]....
View 3 Replies
Jun 16, 2011
When reading and writing data to an XML file, in XML code, through a VB application, how does one go about commenting out a specific XML code line? From what I've gathered the original <!-- and --> tags aren't compatible. So what would be the VB alternative? Or is it just not possible to comment out a line of XML code using XML code through VB?
View 5 Replies
Jan 2, 2012
i'm making a console program that consults a website of my work but it uses https and has a Untrusted certificate so i get this error: This Connection is Untrusted i did some research on the internet about this issue and come up with this code
//for testing purpose only, accept any dodgy certificate. public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
[Code]...
View 6 Replies
Feb 5, 2012
I am a beginner trying to create a console program that lets the user enter a last name, then a first name with only 2 lines of code. The program should then display the first name followed by the last name.
I know how to do this, just not in 2 lines of code.
View 9 Replies
Aug 7, 2009
What is the easiest/simplest way of finding out the number of lines in your VB project?
View 4 Replies
Apr 12, 2010
I have a long line of code and I would like to split it into two lines. I've tried using , _ and & _ but they did not work.
Here is the
vb.net
If c < 1 Or c > 9 Or a = c Or b = c Or a = b Or occupied(b) <> occupiedEnum.empty Or occupied(c) <> occupiedEnum.empty Then
View 6 Replies
Jan 25, 2010
I have a school project. by selecting an item from combobox it will show 2 pictures and 2 labels. I used a select case first but it didn't work; only for the first item ;do i have to make every pictures and labels invisible which are 30 controls and repeat it in every index? I try the if else but it did not work too.[cod]
View 4 Replies
Mar 14, 2011
i have one project (let's call it project1) that is going to add properties to another project's class. The thing is I wanted to make it automatically. So in my project there are two lines of code which I want to add at the bottom of the class.vb or class.cs in a project called project2. Is it possible? If so, how?It is a data access builder software which after adding some new columns to our database we use it to generate its properties and its parameter to be added in BLL. Since we do it often (changing our database structure) I did not wanted to copy data from data access builder software and add it to project2 manually.
View 3 Replies
Aug 8, 2009
If I add let's say 1 line at the beggining of a method, if I set a breakpoint through Visual Studio on the first line, will it point to the first line or the second? If it will flag the wrong line, is there anything we could do when editing .exe files to ensure a regular debugging session later?Isn't there something like setting line x to be Y? I remember seeing something like that somewhere, not sure if .NET related or not.
View 4 Replies
Jun 8, 2011
How to find Lines of Code in VS 2010?
View 7 Replies
Mar 4, 2009
How do I make a pause between code lines? See code below. This just prints the word "Hello", I was hoping to put a delay between the letters to make it look more real. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button2.Click
SendKeys.Send("%{tab}") SendKeys.Send("H") SendKeys.Send("e") SendKeys.Send("l") SendKeys.Send("l") SendKeys.Send("o")
End Sub
View 3 Replies
Aug 15, 2011
I have a form that on load keeps closing without any errors... I have no clue what it wrong with it. How can I record all the lines of code being executed so that I can find out why it is closing. There are no errors or me.closes.
View 3 Replies
Jun 5, 2011
I want to draw three straight lines on a form. if the following code is correct:
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim Line1 As System.Drawing.Graphics
[CODE]........
Can I use only one variable (Line1) to draw three straight lines?
View 2 Replies
Dec 29, 2009
i wrote an application in VB.NET and since i charge by the line, i would like to calculate how many lines i wrote. i have about 100 different vb files with my code. how do i count all the lines?
View 8 Replies
May 18, 2010
I am attempting to hard code a richtextbox that has multiline characters upon the Load_Event. However, whenever I use the "&controlchars.newline _ " I get a syntax error and end of statement expected error.
[Code]...
View 3 Replies
Oct 27, 2011
I want to go back to the input line in the four places in the code that say something like strinputmessage = strnegative or strinputmessage = strnonnumeric.I need to be able to go back to where you input the data so that the index does not increase.I tried using a GoTo <23> to go back up to the line i needed but then it gave me all these weird errors about the End and Next were missing.[code]
View 3 Replies
Feb 11, 2010
I recently inherited a nice size projects with about 100k lines of code and would like to find out what code is actually being run. I've found a number of routines that are not called at all and looking for a fast and automated way to explore the Business Layer to see what other code can be refactored out quickly.
This is an ASP.NET website with VB.NET codebehind and Business Layer.
View 4 Replies
Jan 4, 2010
I have a piece of code that reads in lines of tabbed text. It is a game of who wants to be a millionaire. What I would like to do is get the game to incorporate random questioning.
The format of the text file is as follows:
Which record company did the Beatles create? (tab)Apple Records (tab)Sony (tab)BMG (tab)LiteFM (tab)Apple Records (tab) Which has the highest mountain? (tab)Mars (tab)Ireland (tab)Iceland (tab)America (tab)Mars(tab) With a set amount of lines. I want the program to choose each question randomly and not to repeat the question. I'm not sure how to incorporate it into the code.
Quote:
[CODE].....................
View 1 Replies
Jan 13, 2010
Yes, I've googled. But I must defer to the experts as time to study Regex is not available.
[Code]...
Can these 3 lines be condensed into one line? If so, how? The purpose is to remove all spaces before and after all occurrences of & in a string.
View 3 Replies