4,901 Posted Topics

Member Avatar for guilherme.carvalho.9250

You'll have to read all of the lines into an array, modify the requested line, then write the array back out to the file. All you are doing is modifying the line in memory. Dim lines() as String = IO.File.ReadAllLines(MYFILE) For i As Integer = 0 to Ubound(lines) If lines(i).Contains(... …

Member Avatar for guilherme.carvalho.9250
0
2K
Member Avatar for Dani

I don't recall that we ever had a view counter. Of course, that could just be me.

Member Avatar for gerbil
0
206
Member Avatar for vincent5487

You can start by setting the values of min and max outside the loop as follows Dim min As Integer = Integer.MaxValue Dim max As Integer = Integer.MinValue InputBox returns a string so you can't assign it directly to a numeric variable. You have to convert it. However, just because …

Member Avatar for vincent5487
0
175
Member Avatar for Reverend Jim

I happened to be browsing the code snippets in vb.net and I noticed that in the thread list, a code snippet I contributed a while back is credited to "Reverend Jim", however when you go to the [actual snippet](http://www.daniweb.com/software-development/vbnet/code/423678/create-controls-at-run-time-with-events), it is listed as >By It's just a nickname on May …

Member Avatar for Dani
0
191
Member Avatar for TheQuestor

Tell me in English (not in code) what you want (not just the last part put the whole thing) and I'll see if we can come up with something simpler.

Member Avatar for Reverend Jim
0
171
Member Avatar for Nickair

You don't need to create a bootable disc (or USB) to install Office. You have to have Windows running in order to have somewhere to install Office to. You only need to create bootable media in certain cases such as * to install or reinstall your operating system * to …

Member Avatar for Reverend Jim
0
271
Member Avatar for DarkPyros

First you get the "sermon". Since you are required to write pseudocode anyway, write it first, then prefix each line of pseudocode with a single quote. There. You have just created all of your code comments. Now add the actual code. End of sermon. Now a few suggestions. InputBox("Values must …

Member Avatar for DarkPyros
0
204
Member Avatar for mrbungle

In SQL, to select the largest value from a set of values you use the MAX function as in select MAX(citation) from myTable

Member Avatar for mrbungle
0
145
Member Avatar for Minko

I'm a big fan of letting the computer do as much as it can for you. Generally, the less code I have to write, the fewer chances I have to introduce a bug. In that case: Dim mylist As New SortedList(Of Date, String) For Each line As String In System.IO.File.ReadAllLines("d:\temp\test.txt") …

Member Avatar for Minko
0
6K
Member Avatar for themaj

My.Application.CommandLineArgs returns an array of strings, one string per argument

Member Avatar for themaj
0
404
Member Avatar for kkhembrom

The answer is "it depends". It depends on the type of database (Access, SQL, mySQL, etc), and it depends on the actual data in the field. You can use wildcards in SQL queries such that if your query looks like select * from myTable where MovieName like 'Rocky%' then the …

Member Avatar for Reverend Jim
0
102
Member Avatar for kerek2

You have to use a ListView in details view if you want to use different colours for each line. You can do it as follows: Dim item as New ListViewItem() item.Text = "Bad" item.ForeColor = Color.Red ListView1.Items.Add(item)

Member Avatar for Reverend Jim
0
213
Member Avatar for marky101

I can't imagine how you would do this. When the power goes out your computer goes down immediately. If you have a UPS then the computer doesn't know the power is out. If you have a UPS that can send an event to the operating system then you have to …

Member Avatar for M.Waqas Aslam
0
215
Member Avatar for Reverend Jim

I just submitted a code snippet for the competition [here](http://www.daniweb.com/software-development/vbnet/code/428716/using-detached-recordsets-to-sort-data). I entered my description/documentation, then entered the code after clicking on "Code" and pasting in the code window. I submitted the post and was then presented with another window saying "a fully working code snippet must be entered". So I …

Member Avatar for Reverend Jim
0
257
Member Avatar for HibaPro

You just have to change the name of the server in the connection string. You may have to get the DBAdmin to set up access rights for you.

Member Avatar for Reverend Jim
0
93
Member Avatar for Cobrarr2003
Member Avatar for totalwar235

For once I find myself in complete agreement with Rashakil. If you are looking to better your job prospects then take a programming job, any job, that will get you experience. Programming in University is nothing like programming in the real world. In my opinion (and it is just my …

Member Avatar for jenni01
0
376
Member Avatar for BadVinegar
Member Avatar for valestrom

The only time I ever had to program in binary was on an GE SPPC (stored program process controller) micro computer from 1979-1982. There were no symbolic debuggers (or debuggers of any type) at that time. To debug, you hand assembled some debug code then patched it into unused memory …

Member Avatar for ModernC++
0
2K
Member Avatar for ibpet11

It would help to know something about the input data. Are the lines in each file unique (within that file) or are there possibly duplicate lines? How big are the files (can you state an approximate maximum number of lines?). You read file 2 once for each line in file …

Member Avatar for Reverend Jim
0
3K
Member Avatar for tendaimare

You don't say what database you are using. If it is SQL then you can use the COALESCE function in the query. This function is used to replace NULL values with default values. For example: select LastName,MiddleName,FirstName from myTable May return NULL values for MiddleName, however, the query select LastName,COALESCE(MiddleName,"(none)"),FirstName …

Member Avatar for Reverend Jim
0
586
Member Avatar for alexandra.lopez.94043

I think the easiest way would be to create your own msgbox form. Make sure it has a fixed width font like Courier New and display is as Modal.

Member Avatar for M.Waqas Aslam
0
241
Member Avatar for benscomputers

The easiest way to check is to use a regular expression. Here is an example for your particular requirements: Imports System.Text.RegularExpressions Public Class Form1 Private Sub btnTest_Click(sender As System.Object, e As System.EventArgs) Handles btnTest.Click If Regex.IsMatch(txtTestStr.Text, "^[2-9]\d{2}-\d{3}-\d{4}$") Then txtResult.Text = "Match" Else txtResult.Text = "No Match" End If End Sub …

Member Avatar for benscomputers
0
279
Member Avatar for Eruditio

"Something like" code can't be debugged. What I can do with what you have shown is offer some code that does what I think you want. The following scans the "My Documents" folder on my D: drive and colours the lines based on the age (in months) if the files. …

Member Avatar for Eruditio
0
1K
Member Avatar for iFrolox

Have you looked at [autoit](http://www.autoitscript.com/site/). There is a component, AutoitX, that can be created and used from within vb.

Member Avatar for iFrolox
0
3K
Member Avatar for cheesepotato

How do you propose to click a button in a form that has not yet been opened? And why would you want to?

Member Avatar for cheesepotato
0
763
Member Avatar for alexandra.lopez.94043
Member Avatar for iFrolox

Try For Each Info As String In System.IO.File.ReadAllLines(AccFileR) Info = IDecode.decryptString(Info) 'Debug.WriteLine(Info) Accounts.Add(New Account(Info.Split(CChar(",")))) My.Forms.Main_frm.AccNumber.Items.Add(iCount) iCount += 1 Next

Member Avatar for TnTinMN
0
141
Member Avatar for Reverend Jim

Web Site Not Responding I was trying to go to a thread this morning (06:20 Winnipeg time) and DaniWeb wouldn't display it. All I got was >The connection to the server was reset while the page was loading. I tried several times with the same result. In order to determine …

Member Avatar for Reverend Jim
0
185
Member Avatar for princy.mohan.1

When the picturebox is loaded with a picture you could put a string into the Tag property. When you click on the picturebox you can copy the Tag value to the TextBox.

Member Avatar for Gé48
0
267
Member Avatar for Reverend Jim

I was trying to find a code snippet so I used the advanced search with the following parameters: Query String = encryption Forum = --VB.NET Type of Article = Code Snippet It came back with "No Results" When I did a manual search of code snippets under vb.net I found …

Member Avatar for diafol
0
288
Member Avatar for iFrolox

If you want to handle all textboxes the same way you can create two generic handlers such as Private Sub TextBox_GotFocus(sender As Object, e As System.EventArgs) sender.BackColor = Color.LightGray End Sub Private Sub TextBox_LostFocus(sender As Object, e As System.EventArgs) sender.BackColor = Color.White End Sub then on form load you can …

Member Avatar for iFrolox
0
2K
Member Avatar for iFrolox

Or if you can't or don't want to group the controls, set the Tag property of each to some known value then test in a loop like For Each ctrl As Control In Me.Controls If ctrl.Tag = "my value" Then ctrl.Enabled = True End If Next

Member Avatar for iFrolox
0
192
Member Avatar for HibaPro

To do that you create an installer package. When a user runs the installer it copies all of the files needed to run the application to the user's computer. You can find detailed instructions [here](http://msdn.microsoft.com/en-us/library/k3bb4tfd.aspx)

Member Avatar for Reverend Jim
0
185
Member Avatar for mike_2000_17

And why is it called the “God particle”? Like God, it is everywhere but hard to find, goes the quip. In fact, the origin of the name is rather less poetic. It comes from the title of a book by Nobel physicist Leon Lederman whose draft title was “The Goddamn …

Member Avatar for DavidB
1
167
Member Avatar for Alifarman

Is it possible you have the wrong encryption settings for tis particular wireless connection? It's possible that one end is set to WEP and the other to WPA. Are you being prompted for a network key when you try to connect?

Member Avatar for Dedra
0
99
Member Avatar for Reverend Jim

Forget the problem with commercials being blasted at you, I've noticed in a few of my regular shows lately, noticibly Burn Notice and Royal Pains, dialog is at one volume level, and the music that plays between scenes (camera pans over scenery/cityscape, etc.) is at three times the volume. It …

Member Avatar for VernonDozier
0
182
Member Avatar for Eruditio

>It converts information from hundreds of Excel documents into a few small text files Let's assume your Excel files are named ss-0001.xls, ss-0002.xls, etc. I'm guessing you have two processes at work here. One process runs independently of the GUI app and renders many Excel files into a few text …

Member Avatar for Reverend Jim
0
1K
Member Avatar for Reverend Jim

In case no one has mentioned it before, I just want to say a public thanks to Davey for all of the interesting news items he finds the time to write up and post.

Member Avatar for happygeek
0
41
Member Avatar for Reverend Jim

I think it would be nice to include the original posting date when a related article is suggested. I'd be more inclined to check it out if I knew the article was less than a few months old. More than a year, not so likely.

Member Avatar for Dani
0
53
Member Avatar for gamejump

It's possible the folder has had the S or System attribute set. Open a command (CMD) shell and locate to the folder that contains the missing folder. Let's assume (for this example) that the missing folder is called "dave". At the command prompt type the command attrib dave If you …

Member Avatar for Reverend Jim
0
70
Member Avatar for Reverend Jim

I just finished trying for the fourth time to submit a posting to the "Articles View" thread. Every time I click "Reply", the Reply button disappears but I am left in edit mode.

Member Avatar for Reverend Jim
0
103
Member Avatar for mike_2000_17

I had the cursor offset problem an hour or so ago. I started typing this post and noticed that the cursor started having the same problem in this post. I tried re-entering all of the text to see if I could determine where the problem was occurring but I couldn't …

Member Avatar for Dani
1
563
Member Avatar for satti

If the string contains arbitrary numbers of substrings of the form "Kg###" then you can extract them all using a regular expression as follows Imports System.Text.RegularExpressions Public Class Form1 Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Dim test As String = "_A0+0000002 Kg054__A0+0000002 Kg055__ " Dim rexp …

Member Avatar for Reverend Jim
0
134
Member Avatar for bmfinn

I've always been a big fan of letting the computer do as much work as it can. Don't bother writing the bubble sort. The following code uses a sorted dictionary. The key is the line number (with the "N" removed) and the value is the rest of the line. No …

Member Avatar for Reverend Jim
0
426
Member Avatar for jezguitarist30

Usually, when you make resources on a server available to the network you do it through a share name (or Active Directory name) rather than by a physical path. For example, if your sdf file was physically located on a server named Hermes in the folder D:\database, the users would …

Member Avatar for Reverend Jim
0
365
Member Avatar for WolfShield

A travelling salesman drives into a farmer's yard. As he gets out of the car he sees a three-legged pig walking by the barn. As the farmer comes over to greet him the salesman says, "I'm here to show you the new seed catalog but before I do I have …

Member Avatar for itzarun
0
1K
Member Avatar for Mr.Sunny

Drop a timer on your form. To get the timer to do something every one second, set the Interval property to 1000. To start the timer, set Timer1.Enabled = True. To execute code on every "tick" of the timer, put that code in the Timer1.Tick handler. To stop the timer …

Member Avatar for Gé48
0
180
Member Avatar for sean.downes.96

You can save the last used number in a settings variable. If you go to your project properties (see Project menu), then go to the Settings tab, you can add a settings variable of any time and scope. If the numbers are unique for each user then create a User …

Member Avatar for Reverend Jim
0
206
Member Avatar for Siberian

You could just use the command line ftp.exe with a script file that logs in and lists the directory and pipe the output to a file.

Member Avatar for Siberian
0
82

The End.