Click here to Skip to main content
15,922,166 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Is there a customer control that can handle text and pictures Pin
John Kuhn5-Feb-04 10:33
John Kuhn5-Feb-04 10:33 
GeneralRe: Is there a customer control that can handle text and pictures Pin
Dave Kreskowiak5-Feb-04 11:03
mveDave Kreskowiak5-Feb-04 11:03 
GeneralHELP!!!!! on Forms Pin
Namboy825-Feb-04 6:26
Namboy825-Feb-04 6:26 
GeneralRe: HELP!!!!! on Forms Pin
John Kuhn5-Feb-04 10:16
John Kuhn5-Feb-04 10:16 
GeneralCOM Interop Attributes Pin
Jim Taylor5-Feb-04 5:45
Jim Taylor5-Feb-04 5:45 
GeneralRe: COM Interop Attributes Pin
Mike Dimmick6-Feb-04 3:34
Mike Dimmick6-Feb-04 3:34 
GeneralRe: COM Interop Attributes Pin
Jim Taylor6-Feb-04 3:47
Jim Taylor6-Feb-04 3:47 
Generalvb.net, timer, run program every 5 mins Pin
Chrissy Callen5-Feb-04 3:09
Chrissy Callen5-Feb-04 3:09 
Hi Smile | :)
ive created a program that will read a file, check it for the word "error" and then email me with a list of all new errors in the file. im now trying to get the program to read the file every 5 minutes and then send email notification only if there are new errors - could some1 pls help? here's my code so far, which was working until i started to get the timer working!
Imports System
Imports System.IO
Imports System.Collections
Imports System.Web
Public Class Form1
Inherits System.Windows.Forms.Form
Private Shared myTimer As New System.Windows.Forms.Timer
'Private Shared exitFlag As Boolean = False
Private Shared Sub TimerEventProcessor(ByVal myObject As Object, ByVal myEventArgs As EventArgs)
myTimer.Stop()
Dim LineNo As String
Dim CurrentLineNo As New Integer
If GetSetting("OrEM", "Settings", "LineNo") = "" Then
SaveSetting("OrEM", "Settings", "LineNo", "1")
End If
LineNo = Val(GetSetting("OrEM", "Settings", "LineNo"))
Dim objReader As New StreamReader("c:\ProjectSearch\sx3liveALRT.LOG")
Dim sLine As String = ""
Dim arrText As New ArrayList

Do
sLine = objReader.ReadLine() : CurrentLineNo = CurrentLineNo + 1
If CurrentLineNo >= LineNo Then
If InStr(UCase(sLine), "MON") Or InStr(UCase(sLine), "TUE") Or InStr(UCase(sLine), "WED") Or InStr(UCase(sLine), "THU") Or InStr(UCase(sLine), "FRI") Or InStr(UCase(sLine), "SAT") Or InStr(UCase(sLine), "SAT") Then
sLine = objReader.ReadLine() : CurrentLineNo = CurrentLineNo + 1
If InStr(UCase(sLine), "ERROR") Then arrText.Add(sLine)
While sLine <> ""
sLine = objReader.ReadLine() : CurrentLineNo = CurrentLineNo + 1

End While
End If
End If
If Not sLine Is Nothing Then

End If
Loop Until sLine Is Nothing
objReader.Close()
'create mail notification
Dim mailMsg As New System.Web.Mail.MailMessage
mailMsg.BodyFormat = Mail.MailFormat.Text
mailMsg.To = "???"
mailMsg.Subject = "???"
mailMsg.From = "???"

Dim txtBody As String

For Each sLine In arrText
txtBody = txtBody & sLine & vbCrLf
Next

mailMsg.Body = txtBody
System.Web.Mail.SmtpMail.SmtpServer = "???"
System.Web.Mail.SmtpMail.Send(mailMsg)
SaveSetting("OrEm", "Settings", "LineNo", Trim(Str(CurrentLineNo - 2)))
LineNo = Val(GetSetting("OrEM", "Settings", "LineNo"))


' myTimer.Start()

'adds the event and the event handler for the method that will process the timer event to the timer
AddHandler myTimer.Tick, AddressOf TimerEventProcessor
CurrentLineNo = 0
'sets the timer interval to 5 minutes
myTimer.Interval = 30000
myTimer.Start()
'runs the timer, and raises the event
' While exitFlag = False
'Processes all the events in the queue
Application.DoEvents()
'End While
End Sub



Chrissy Callen
GeneralRe: vb.net, timer, run program every 5 mins Pin
Ray Cassick5-Feb-04 6:39
Ray Cassick5-Feb-04 6:39 
GeneralRe: vb.net, timer, run program every 5 mins Pin
Chrissy Callen5-Feb-04 23:01
Chrissy Callen5-Feb-04 23:01 
Questionhow to set path? Pin
emmshazi5-Feb-04 2:05
emmshazi5-Feb-04 2:05 
AnswerRe: how to set path? Pin
Dave Kreskowiak5-Feb-04 9:35
mveDave Kreskowiak5-Feb-04 9:35 
GeneralRe: how to set path? Pin
emmshazi6-Feb-04 2:00
emmshazi6-Feb-04 2:00 
GeneralRe: how to set path? Pin
Dave Kreskowiak6-Feb-04 2:50
mveDave Kreskowiak6-Feb-04 2:50 
GeneralTrueDBGrid CellTips question Pin
gpa20004-Feb-04 23:57
gpa20004-Feb-04 23:57 
GeneralRe: TrueDBGrid CellTips question Pin
stepdaddy5-Feb-04 0:33
stepdaddy5-Feb-04 0:33 
GeneralRe: TrueDBGrid CellTips question Pin
gpa20005-Feb-04 2:55
gpa20005-Feb-04 2:55 
GeneralRe: TrueDBGrid CellTips question Pin
gpa20008-Feb-04 20:47
gpa20008-Feb-04 20:47 
QuestionHow to add pictures to your database from the front end Pin
fready4-Feb-04 20:43
fready4-Feb-04 20:43 
AnswerRe: How to add pictures to your database from the front end Pin
Hesham Amin4-Feb-04 22:39
Hesham Amin4-Feb-04 22:39 
GeneralImage Scanning in VB with ADO conrol Pin
praveed4-Feb-04 19:13
praveed4-Feb-04 19:13 
GeneralRe: Image Scanning in VB with ADO conrol Pin
stepdaddy5-Feb-04 0:41
stepdaddy5-Feb-04 0:41 
GeneralRe: Image Scanning in VB with ADO conrol Pin
Dave Kreskowiak5-Feb-04 8:20
mveDave Kreskowiak5-Feb-04 8:20 
GeneralCall a form&#8217;s sub from a Sub Main() Pin
gregcost4-Feb-04 18:32
gregcost4-Feb-04 18:32 
GeneralRe: Call a form&#8217;s sub from a Sub Main() Pin
John Kuhn4-Feb-04 19:49
John Kuhn4-Feb-04 19:49 

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.