Public Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
OpenFileInArrayList(My.Application.Info.DirectoryPath & "/data/ck.dat", ArrayListCK())
End SUb Public Sub OpenFileInArrayList(ByRef PathFile As String, ByRef ArrayListCC As ArrayList)
Dim stream_reader As New IO.StreamReader(PathFile,System.Text.Encoding.UTF8)
I would like to know if there is a quicker way to load a text file into a listbox/arraylist than this:
Code: Dim fileList as New ArrayList Dim fileReader As New System.IO.StreamReader("textfile.txt") Do While fileReader.Peek() <> -1
[Code].....
If I need to load several text files into different arraylists, especially if the textfiles have a lot of lines, this process is very slow. Too slow for my current app to work smoothly, actually.
So, is there any faster ways to load a text file into an arraylist? Or if there isn't, is there some quick way to easily access and change data that is on a particular line in a textbox, so that I don't have to load the text file into an arraylist?
I'm trying to read and load the content from the attached text file to a arraylist with the code bellow. but what is happening is that not all the lines from the text file are loaded in to the arraylist, the reading jumps from one line to other in the text file.
Dim FILE_NAME As String = ((My.Application.Info.DirectoryPath).Substring(0, (My.Application.Info.DirectoryPath).LastIndexOf(""))) & " est.txt" Dim lista_barras As New ArrayList Dim lista_barras_esp As New ArrayList
i would like to have a shared function in a separate class file to address the form location . but i dont know how can i get this to work. if i use this below code in my form its working . but i cannot move this to a class file.
Shared Sub Formlocation() Me.StartPosition = FormStartPosition.Manual Me.Location = Screen.GetWorkingArea(Me).Location End Sub
[code] I'm trying to load a textfile with (formatted, mostly tab delimited) data, into an arrayList.To manipulate and extract certain data I was able to search through the arrayList and retrieve the needed data.This is what's not working: If I have found my needed data in certain places from the arrayList, I would like to split this to read the needed values. Trying to do this I constantly get string cannot be converted to 1-dimensional array of string errors. [code]
Im making a program to list something from a xml file to show it in a listview, but im having some problems. The early versions of the code where able to read thru the xml file faster than the newer one... Does anyone know of any other method of reading a xml file? Here's my code :
PHP
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click op.Filter = "Xml|*.XML"
[Code].....
I've been looking around for a loop that does things uh.. A bit faster but i didn't find any.
I have a pc where I installed SAP Crystal Reports, version for Visual Studio 2010 - Standard (downloadfilename: CRforVS_13_0_3.exe) I even installed CRforVS_redist_install_32bit_13_0_3.zip on this pc. Here is my problem: I have a form containing a crystalreportsviewer.In the code behind I load crystalreport1:
Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Imports System Imports System.Data
When I try to play an audio file through DirectX, that isn't my development machine, I receive this error.
The DirectX library I'm using is Microsoft.DirectX.AudioVideoPlayback.dll.
I include the library when I build the application and I thought that would work. Both PCs have the same version of DirectX installed. So what else do I need to install?
The app itself is meant to run on a USB, so I can't install it, but I'm able to install 3rd party libraries during the initial load.
I've written several loading programs in the past, but never with VB.NET, always VB 6.0.I need to load a text file (actually, there are 24 per day), into our Oracle database. I have the file open and I can read it no problem, the question is, what's the best way to load it?
In the past, I've always read a record into an array and then passed the array as a variable into the Oracle statement in my code - basically loading one record at a time. I'm wondering if there's a better way to do this, specifically in the new world of VB.NET. Is there a way to load everything at once, rather than running an INSERT statement for every record individually?
Visual Basic 2010 Windows Forms Application I am trying to create an application that will allow a user to choose from a menu option in ListBox, click "Play" button, and the application will play music, and transition between 3 pictures.
I'm using FileSystemWatcher in an application.it monitors the files in a folder, then do some processing. I monitor FileCreate, Change, Rename, Delete event.the problem is: when I copy some images to that folder, it fired the create event, but the file is not actually ready, so, when I load the file in the event handler, it failed.how can deal with this correctly?
1. Can I include a database in an exe file? - I am trying to create a small launcher application which contain 10-20 IP addresses with name, addresses, phone and email for people I help out on a regular basis. I would prefer if I could have the DB containing this info included in my launcher app, so I could carry it around on a USB stick.
2. How do I get mstsc.exe (remote desktop) to launch with an IP address from my DB above?- In my small app I am trying to add a launch button for each person. So if I am helping "person1", then I click the button next to him, and it launches my remote desktop of PC Anywhere to his IP address....
My initial thought was to use an ini file with my exe file, and modify the ini file with data through the app, but I want to be sure that there is no way I can include this information in the exe file.As I want to be able to change the connection information through my app interface I reckon I am forced to use either a SQL DB or some sort of file DB right?
I'm calling a 3rd part app which 'sometimes' works in VB.NET (it's a self-hosted WCF). But sometimes the 3rd party app will hang forever, so I've added a 90-second timer to it. Problem is, how do I know if the thing timed out?
Code looks like this:
Dim MyProcess as System.Diagnostics.Process = System.Diagnostics.Process.Start(MyInfo) MyProcess.WaitForExit(90000)
What I'd like to do is something like this
If MyProcess.ExceededTimeout Then MyFunction = False Else MyFunction = True End If
I'm using the following code to import data from a text file into an existing Access table:
[Code]...
The first time i ran the code, it caused no error but no records where loaded into the table. The second time it causes the OleDbException "Table 'TEMP' already exists."explain me wath am i doing wrong? The text file is comma delimited and it has exactly the same number of columns of the TEMP table.
Before I begin I would like to mention that I am not a noob in VB, it's just I've never had to do anything this complex before.Basically what I want is to have a program that you can load a txt file in, have it copy key words, and paste it in a textbox so I can use it later on.So in this text file, there is a bunch of info, but I am only needing a certain part.Here is an example of a text file (actually a .dat file, but is easily read):
s t y l e T h e m e d s h y - A l p i n e V i l l a g e S e t S t y l e & h y - a v p o s t 1 H a n g 3 , V ¯s t y l e T h e m e d s h y - A l p i n e V i l l a g e S e t S t y l e , y - a v p o s t 1 H
What I am doing is iterating through all the groups that belong to the top group (Generic reports). Then I take advantage of the GroupPrincipal.GetMembers(True) which will recurse through a given group name. I test to see if the user exits under that group and if true I put the group name in an arraylist.
I use the for each principal in GroupPrincipal.GetMembers to loop through each returned user to see if they exist.
Is there a way to put all the returned users Principal.Name from a given group in GroupPrincipal.GetMembers into an ArrayList? This would allow me to to use Arraylist1.IndexOf to search for user. Which would be much faster then iterating through a returned list using the for each construct.
Sub RetAllMbrs(strUser As String) Dim oPC As PrincipalContext = GetPrincipalContext() '<- this is function somewhere else in the code
I am working on an application which compiles fine on machine that is Win 7 and 64 bit CPU. But when copy and I run the exe file on similar machine (Win 7 64bit) I get error message: Error: Could not load file or assembly 'Interop.ActiveDs.Version=1.0.0.0,... I have added ActiveDS Type Library 1.0 C:WindowsSysWow64activedstlb as a reference in the project file.
The code search for the specified bytes in jpg file and when first match is founded msgbox gives you position of the bytes in the file and Function stops. [Code] Now, because I am newbie to VB I have one question. How can I change the Function so that Function search the whole file for all byte matches?
I'm working on an application, a GUI front-end for a command-line program. What I need to do is this:-use the OpenFileDialog to retrieve the command-line program's path (as it may be in different places for different users)-save that path string in a variable that I can use later (save "C: arget" in a variable called mainPath)
In the code below there is a inparameter named thumbs to the function CreatePage. thumbs is an arraylist. My question is if you know if it's possible to split the arraylist thumbs into parts of 15 and call the function with thumbs(1-15), thumbs(16-30), thumbs(31-45) and so on. Until the arraylist is empty.
I have an arraylist (arrFirstArry) which I use to populate another arraylist (arrNoDuplicates) preventing any duplicates from being added. This works fine. What I would also like my code to do is prevent adding any partial values which may exist from being added. i.e. my array is like this
I have two structures Public Structure myResearchData
Public batchName As String Public arraylistRData As ArrayList End Structure Public Structure myResearchSubData Public researchDescription As String
[Code]...
Cleared MyResearchData.arraylistRData for new data to be put in but it also clears the arraylist inside MyResearchDataAList and didn't old the contents of the arraylist
What I need to do is read an ArrayList in My.Settings and add another ArrayList to it. The first think I'm trying to do is load My.Settings.Records into myArrayList. I'm not quite sure on the proper way to do this. I've tried things such as Dim myArrayList As ArrayList = My.Settings.Records, I'm not sure if I need New and I'm not sure if I need .Clone or .CopyTo.
Then I have another ArrayList myArrayList2. To get this into myArrayList I've done: [Code] Then to save it back to My.Settings I've done. My.Settings.Records = myArrayList. The problem is I keep on getting Object reference not set to an instance of an object error on the AddRange line. My.Settings.Records is definitely an ArrayList and it will sometimes = Nothing. The objects will only ever be strings.