o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Making A FSO searcher -

Hi all

I am in the process of making a FileSystemObject searcher which searches a rather large text document. I have so far made it to find a certain word within the text document but i want it to return the whole line that the word is found on, and then continue searching for the other instances of the search criteria. Is this possible?? I have attached my code so far


Regards

Code:
        Dim MyReader As Microsoft.VisualBasic.FileIO.TextFieldParser
        Dim objFSO As String

        Dim sFilename As String
        Dim sFileBuffer As String
        Dim sSearch As String
        Dim bVal As Boolean



        sFilename = "c:\Scans\test.txt" 'Form1.txtLocat.Text
        sSearch = txtFind.Text

        'objFSO = CreateObject("Scripting.FileSystem Object")

        MyReader = My.Computer.FileSystem.OpenTextFieldParser(sFilename)

        sFileBuffer = MyReader.ReadToEnd

        If InStr(1, sFileBuffer, sSearch, vbTextCompare) <> 0 Then
            bVal = True
            MsgBox("found")

        Else
            bVal = False
            MsgBox("not found")
        End If



        MyReader.Close()

        MyReader = Nothing
        objFSO = Nothing
i am using vb 2008

 

Making a simple Searcher -
okie im just wondering what i want to do is make a simple searcher from poplular site aka google yahoo ask ect but say like i wana search for all the sites with xbox360 in there URL adreass and list them but only search for what i put in the search box how would i go making a s


RESOLVED [2005] Get Email Address from Active Directory -
Hi all - I'm looking for a simple way to pull the email address for specific user by using active directory. Below is an example I found on the forum ... but not sure what to use for 'entry'? Again I'd like to search AD by username for the email address. Then just return the


PhysicalMedia problem in web application -
Not sure where to put this --- I'll start here. Hoping to obtain HD serial number in a web application.. I'm using the following code in global.asax.vb : Dim searcher As New Management.ManagementObjectSearcher("select * from Win32_PhysicalMedia") Dim wmi_HD As Manageme


Outputting Data -
Hi Everyone, I am having troubles outputting anything but the "cn" of a user account from AD. How am I able to out the "mail" or "department" property from the user account? Code: Imports System Imports System.DirectoryServices


DirectoryService Problem -
I'd tried to queries my Novell LDAP server, and here is my code: Dim root As New System.DirectoryServices.DirectoryEntry("ldap://192.168.0.13/o=test/ou=Admin", "myname", "123456") Dim searcher As New System.DirectoryServices.DirectorySearcher(r


[2008] Antivirus Type and Last update -
Hi, I am using the code to show if antivirus is installed and to display its name. What other options are available under the Dim searcher As New Management.ManagementObjectSearcher("SELECT * FROM antivirusproduct") like last update etc Code: Imports System.


DirectoryServices question -
At first I'd like to say hello to all of you becouse this is my first post here I'm trying to search AD using direstoryservices in vb 2008. This is the code: Code: Dim dsepath As String = "DC=this,DC=is,DC=my,DC=ad,DC=domain" Dim entry As New DirectoryEntry(d


[FTP SEARCHER] Help Plz -
Hey guys buddy of mine was looking for a search engine for his ftp. Reason being he has well over 4 tera bytes on it and is getting harder and harder to manage it all. So here is what i need to know how to do i want my application to compare the contents of textbox1.text with the conte


directorySearcher error -
ive never had this before but no matter what I always get the error "A referral was returned from the server". Any ideas? string path = "LDAP://CN=users,DC=myDomain,DC=co.uk"; DirectoryEntry users = new DirectoryEntry(path);


Making A FSO searcher -
Hi all I am in the process of making a FileSystemObject searcher which searches a rather large text document. I have so far made it to find a certain word within the text document but i want it to return the whole line that the word is found on, and then continue searching for th


[2008] How to make a textbox Searcher -
How to make a textbox searcher but not a simple one, I need to make one that will search with only two parts of a word or something else, the first part and the last. Example: The word is visualbasic2008expressedition and I write visual and edition and It finds the whole word. Is there


Database App finally finished...I hope...... -
Hey, for those of you that have helped me over the last week or so, my file recorder and searcher program is finally finished... First, I thank each and everyone of you that took the time to help a poor beginner database programmer down on his luck and in a strange new world.....lol


strstr() with a string -
O.K. how do you use the strstr function I just can not figure it out or is there something else i can do i am reading from a file line by line and sticking it in a string each time i read in a new line i want to be able to search through it for a particular string....for example:


System.Management Mediatype Values -
I ran accross this piece of code that uses the System.Management to get the free space on a drive for ONLY logical drives on Hard disks drives. It does this by check the Mediatype. Anybody know where I can find a listing of the Mediatype values? I would like to modify this to get fr


Display OU's in a ListBox -
Guys. Some of you may have remembered that i was trying to query AD for all the Exchange DL's and display them in a list box. Well i would like to do the same only this time with all the OU's With the code i have below can anyone help me change it so it will display OU's Thank


[2008] Convert code -
I need to convert the following code to work in a visual studio 2008 windows form application, can anyone help? At the moment ObjectQuery, ManagementObjectSearcher, ManagementObject and ManagementObjectCollection are not valid. Code: Dim objectQuery As New Objec


System Information Class. -
Here some i retreived only some informations. I will add more informations in this. System Information Class Code: Imports System.Data.SqlClient Imports System.Diagnostics Imports System Imports System.Collections.Generic Imports System.ComponentModel Imports System.Data Impor


File Searcher -
Can somebody help me and tell how to do program, which finds a wanted file from a disk?


Event Load Cannot be found -
Guys. I have an issue i introduced a sub called Private Sub EU_LEGAL1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Which worked great. Then i put another sub in called Private Sub EU_LEGAL2_Load(ByVal sender As System.Object, ByVal e


Problem reading ActiveDirectory UserAccountControl property -
Hi everyone- Hopefully this is an easy one... I'm trying to detect the status of an Active Directory user's account (disabled, password expired, locked, etc). No matter what the user's account is actually set to, it always returns that the account is normal (512, or ADS_UF_NORMAL


[2005] Freespace with long decimal number -
Hi Here I have freespace code and I wonderin how I could display freespace with two decimal numbers like 49.54GB?? Here it the code: Code: Dim processHandle As UInt64 ' Integer Dim freespace As Integer 'Decimal Dim query As New Management.ObjectQuery("


[2005] Active Directory - Get all OU's undernath an OU -
I am trying to search for all users under an OU. However, one OU may contain other OU's underneath of it. For instance, the tree structure would look kind of like: Country -USA --NJ ---City --NY Since, the structure could change at any time I don't know how many sub OU's


[2005] listview control add items (WMI) -
Ok, I am missing something simple on how to format a listview. I have a form with 2 controls on it. listview and a button. In the onclick I have the following code. Code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.C


Dataset on a background worker - driving me mad! -
OK, this is probably a total newbie question but it's driving me mad. I run the following code via a BackgroundWorker. Sub GetServices(ByVal sender As Object, ByVal e As DoWorkEventArgs) Dim Query As New ObjectQuery("select Name,StartMode,State,Description from Win32_Se


[2008] Harddrive Free Space/Mobo Info/IP -
Good Afternoon, I have almost everything on our management program but there is a couple of things I can't grab from the system so was wondering if someone can help me? 1: I need to be able to get the Free Space on the C: Drive. No other drive is required and no other information


why its showing error -
i m trying to retrieve mac addresses,ipaddress of the remote system using machine name by interacting with wmi ,but my code throwing error of management exceptions the code is in c#,sorry for the inconvinience. string ComputerName="sai.test.com"; //Ping pin = n


[2005] i am facing error "Not all code path return a value" -
hi all i am doing this activity in a web service but the above mentioned error arises here, some body please re-arrange this code, and also i wnat to describe this code, that it gives overall cpu usage in percentage. please arrange this code Code: this code is written in


[2008] WMI Problem during CPU Code. -
Good Morning Folks, For a bit of a quirky problem that is doing my nut in. I am using te WMI to get lots of information from our computers to keep our central database up to date and it is almost working lovely. EXCEPT: The bit of code that does the Processor (Processor Info / Cores


Active Directory with LDAP retrieving user object properties (TS Path) -
I'm trying to obtain the Terminal Services Profile Path for a user using VB.Net and the System.DirectoryServices.DirectorySearcher. I am able to get the user object's first name, last name, city, state, zip, etc. However, there is one property that eludes me. I cannot manage to find


Making a calculator -
Well im making a claculator because im bred of the projects we do in visual basic class :P Anyhow what will be the best way to go about having the #'s put in ? and then making it so it can add subtract divide and multiply.


[2005] Very Urgent! need help with the search -
hi all can you guys help mi solve this problem as i really have no idea how to continues doing it.. basically my program is a phonelist searcher and is able to add new number in i somehow mange to finish the adding the new number but searcher for the number seen to be too hard for me


[2008] WMI Access Denied -
I am trying to write some code to read the application pools from a remote machine and then eventually I will want to recycle one of the pools. I am trying to use the following code to retrieve the application pools, however I am getting an Access Denied error on the For Each line. T


Need some help with memory editing -
Hello, I'm new to these forums. I was referred here by a friend who said you're very helpful and have a lot of answers. Just what I need! I'm quite new to programming; I've just picked it up half a year ago and have only really mucked around with basic things. It's a challenge making s


Making a graph... -
Ok, one of my projects involves me making a graph in order to display temperature from a sensor over a period of time. Personally, I don't even know where to begin. At the moment I'm concerned about making something that will display the data to a form. Any suggestions? I take it in


[2008] Problem sending stuff to Varibles from WMI -
Good Morning, This is a bit of a strange one that probally has a really simple answer that almost everyone knows but because I am a begginer I don't know what I am doing. I would bug my collegue with this one as he is the vb.net king here :-p but he is currently in a meeting so was


[2005] Calling a BackGroundworker Sub but without parameters -
The following code retrieves a list of services and I run it via a BackgroundWorker. It works very well but I need to be able to call it on an adhoc basis. For example, the user can stop/change the service via the GUI so I need to requery the services again so that the dataset is upd


What are you making -
Noone seems to boast about projects they have made or are making. I cannot anyway because i have nothing were to show. But my current project is a database to store API, Code and Tutorials. Hopefully the user can add new, edit and delete items. This will be especially useful for n00bs


Toolboxes... -
I am making a drawing prog (well, its a bit more than that, but anyways...) How would I go about making a toolbox? Like the ones in VB that have a bunch of icon/buttons on them, and are locked to the side of the window, but can be moved around as you please? Its the moving around


[2008] creating command line proggy. paging help -
Hey guys, thought it would be a good idea on creating a command line for WMI. for example, i got this working: myexe /p [outputs a whole bunch of information on the processor] but the thing is that its too much information for it to fit on one page so i have to scroll up to v


[2008] Active Directory groups in forms -
Hi all, I am writing an application where active directory validation is required before accessing the main form. There are 2 forms. Form 2 is the login form and form 1 is the main form. The main form would have a simple look, with about 10 checkboxes. I have managed to get the aut