Click here to Skip to main content
15,901,426 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to make a program that is able to save data ? Pin
Me0w!8-May-07 8:58
Me0w!8-May-07 8:58 
GeneralRe: How to make a program that is able to save data ? Pin
Dave Kreskowiak8-May-07 10:05
mveDave Kreskowiak8-May-07 10:05 
GeneralRe: How to make a program that is able to save data ? Pin
Me0w!8-May-07 10:21
Me0w!8-May-07 10:21 
QuestionDeleting multiple rows Pin
TAK788-May-07 8:00
TAK788-May-07 8:00 
AnswerRe: Deleting multiple rows Pin
Dave Kreskowiak8-May-07 8:13
mveDave Kreskowiak8-May-07 8:13 
GeneralRe: Deleting multiple rows Pin
TAK788-May-07 8:39
TAK788-May-07 8:39 
GeneralRe: Deleting multiple rows Pin
TAK788-May-07 8:53
TAK788-May-07 8:53 
Questionsearch hard drive for files Pin
jds12078-May-07 7:36
jds12078-May-07 7:36 
I am trying to write a program that will search the hard drive for files using windows service in vb.net. I already created the service, but I am not sure if my code to search for files is correct. Does anyone have any suggestions or samples on how to search for files using vb.net. Here is the code that I have below:

Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
Timer1.Enabled = True
SearchFiles(".txt")
End Sub

Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your service.
Timer1.Enabled = False
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'Check if the event log exists
If Not System.Diagnostics.EventLog.SourceExists("MyService") Then
'Create Log
System.Diagnostics.EventLog.CreateEventSource("MyService", "Myservice Log")
End If
EventLog.Source = "MyService"
'Write to the log
System.Diagnostics.EventLog.WriteEntry("MyService Log", "This is log on " & _
CStr(TimeOfDay), EventLogEntryType.Information)
End Sub

Private Sub SearchFiles(ByVal FileType As String)
Dim FilePath As String = "c:\"
Dim rootDi As New DirectoryInfo(FilePath)
Dim Di As DirectoryInfo

For Each Di In rootDi.GetDirectories
Directory.GetFiles(FilePath, FileType)
Next
End Sub

Please help!

jds1207
AnswerRe: search hard drive for files Pin
MatrixCoder8-May-07 7:59
MatrixCoder8-May-07 7:59 
AnswerRe: search hard drive for files Pin
Dave Kreskowiak8-May-07 8:10
mveDave Kreskowiak8-May-07 8:10 
GeneralRe: search hard drive for files Pin
jds12078-May-07 10:21
jds12078-May-07 10:21 
GeneralRe: search hard drive for files Pin
Dave Kreskowiak8-May-07 10:32
mveDave Kreskowiak8-May-07 10:32 
GeneralRe: search hard drive for files Pin
Dave Kreskowiak8-May-07 17:24
mveDave Kreskowiak8-May-07 17:24 
GeneralRe: search hard drive for files Pin
P P Vilsad8-May-07 21:21
P P Vilsad8-May-07 21:21 
AnswerRe: search hard drive for files Pin
P P Vilsad8-May-07 21:18
P P Vilsad8-May-07 21:18 
QuestionStart up Pin
scorp_scorp8-May-07 7:23
scorp_scorp8-May-07 7:23 
AnswerRe: Start up Pin
MatrixCoder8-May-07 7:55
MatrixCoder8-May-07 7:55 
AnswerRe: Start up Pin
nlarson118-May-07 7:58
nlarson118-May-07 7:58 
QuestionDataGridView - Display Row Numbers on Control Pin
RichardBerry8-May-07 4:26
RichardBerry8-May-07 4:26 
AnswerRe: DataGridView - Display Row Numbers on Control Pin
Rupesh Kumar Swami8-May-07 5:27
Rupesh Kumar Swami8-May-07 5:27 
GeneralRe: DataGridView - Display Row Numbers on Control Pin
RichardBerry8-May-07 7:43
RichardBerry8-May-07 7:43 
QuestionOffice 2007 ActiveX Pin
Stijn Courtheyn8-May-07 4:26
Stijn Courtheyn8-May-07 4:26 
QuestionNeed help with Word template Pin
Jats_4ru8-May-07 2:33
Jats_4ru8-May-07 2:33 
QuestionExtracting data from Web pages Pin
Farazj8-May-07 1:29
Farazj8-May-07 1:29 
Questionhow to access dynamically created control Pin
WorkingAcc8-May-07 1:07
WorkingAcc8-May-07 1:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.