Click here to Skip to main content
15,896,453 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionError While Creating Publish Pin
vurugonda3-May-07 7:53
vurugonda3-May-07 7:53 
QuestionInstalling a Windows Service and the GAC Pin
Terry Porter3-May-07 6:04
Terry Porter3-May-07 6:04 
AnswerRe: Installing a Windows Service and the GAC Pin
kubben3-May-07 6:24
kubben3-May-07 6:24 
GeneralRe: Installing a Windows Service and the GAC Pin
Terry Porter3-May-07 6:33
Terry Porter3-May-07 6:33 
Questionsearch for files Pin
jds12073-May-07 5:35
jds12073-May-07 5:35 
AnswerRe: search for files Pin
kubben3-May-07 6:31
kubben3-May-07 6:31 
GeneralRe: search for files Pin
jds12073-May-07 7:53
jds12073-May-07 7:53 
AnswerRe: search for files Pin
jds12073-May-07 10:03
jds12073-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
aamn13-May-07 5:18 
AnswerRe: vb-dll problem Pin
nlarson117-May-07 7:30
nlarson117-May-07 7:30 
QuestionRe: vb-dll problem Pin
aamn110-May-07 19:13
aamn110-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
wpoopsi3-May-07 4:54 
Questiontoolbar image blur's automatically VS 2005 Pin
Rizwan Bashir3-May-07 4:45
Rizwan 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
Sonia 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
Sonia Gupta3-May-07 1:24 
QuestionReading large file and Updating database Pin
virendra_0073-May-07 0:21
virendra_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
TheEagle3-May-07 0:19 
AnswerRe: Text_Changed is not working Pin
_mubashir3-May-07 0:52
_mubashir3-May-07 0:52 
GeneralRe: Text_Changed is not working Pin
TheEagle3-May-07 6:31
TheEagle3-May-07 6:31 
AnswerRe: Text_Changed is not working Pin
Guffa3-May-07 1:48
Guffa3-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.