Click here to Skip to main content
14,827,034 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionError While Creating Publish Pin
vurugonda3-May-07 7:53
Membervurugonda3-May-07 7:53 
QuestionInstalling a Windows Service and the GAC Pin
Terry Porter3-May-07 6:04
MemberTerry Porter3-May-07 6:04 
AnswerRe: Installing a Windows Service and the GAC Pin
kubben3-May-07 6:24
Memberkubben3-May-07 6:24 
GeneralRe: Installing a Windows Service and the GAC Pin
Terry Porter3-May-07 6:33
MemberTerry Porter3-May-07 6:33 
Questionsearch for files Pin
jds12073-May-07 5:35
Memberjds12073-May-07 5:35 
AnswerRe: search for files Pin
kubben3-May-07 6:31
Memberkubben3-May-07 6:31 
GeneralRe: search for files Pin
jds12073-May-07 7:53
Memberjds12073-May-07 7:53 
AnswerRe: search for files Pin
jds12073-May-07 10:03
Memberjds12073-May-07 10:03 
Here is some code that I wrote but I am not sure if it is right.

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 Diagnostics.EventLog.SourceExists("MyService") Then
'Create Log
Diagnostics.EventLog.CreateEventSource("MyService", "Myservice Log")
End If
EventLog.Source = "MyService"
'Write to the log
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

Am I using the code above correctly? I am trying to search for files using windows service in vb.net 2005. I want to be able to specify which file type I am searching for. Please help.

jds1207
Questionvb-dll problem Pin
aamn13-May-07 5:18
Memberaamn13-May-07 5:18 
AnswerRe: vb-dll problem Pin
nlarson117-May-07 7:30
Membernlarson117-May-07 7:30 
QuestionRe: vb-dll problem Pin
aamn110-May-07 19:13
Memberaamn110-May-07 19:13 
Questionerror [modified] Pin
Xmen Real 3-May-07 5:09
professional Xmen Real 3-May-07 5:09 
QuestionCalling a DB2 COBOL Stored Procedure Pin
wpoopsi3-May-07 4:54
Memberwpoopsi3-May-07 4:54 
Questiontoolbar image blur's automatically VS 2005 Pin
Rizwan Bashir3-May-07 4:45
MemberRizwan Bashir3-May-07 4:45 
QuestionChanging Crystal Report's connection at runtime Pin
BooleanTrue3-May-07 3:27
professionalBooleanTrue3-May-07 3:27 
AnswerRe: Changing Crystal Report's connection at runtime Pin
Tarakeshwar Reddy3-May-07 4:02
professionalTarakeshwar Reddy3-May-07 4:02 
Questiondsn in vb.net Pin
Sonia Gupta3-May-07 2:32
MemberSonia Gupta3-May-07 2:32 
AnswerRe: dsn in vb.net Pin
Dave Kreskowiak3-May-07 4:43
mveDave Kreskowiak3-May-07 4:43 
Questionimages in the crystal reports (vb.net 2005) Pin
Sonia Gupta3-May-07 1:24
MemberSonia Gupta3-May-07 1:24 
QuestionReading large file and Updating database Pin
virendra_0073-May-07 0:21
Membervirendra_0073-May-07 0:21 
AnswerRe: Reading large file and Updating database Pin
Tarakeshwar Reddy3-May-07 3:32
professionalTarakeshwar Reddy3-May-07 3:32 
QuestionText_Changed is not working Pin
TheEagle3-May-07 0:19
MemberTheEagle3-May-07 0:19 
AnswerRe: Text_Changed is not working Pin
_mubashir3-May-07 0:52
Member_mubashir3-May-07 0:52 
GeneralRe: Text_Changed is not working Pin
TheEagle3-May-07 6:31
MemberTheEagle3-May-07 6:31 
AnswerRe: Text_Changed is not working Pin
Guffa3-May-07 1:48
MemberGuffa3-May-07 1:48 

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.