Click here to Skip to main content
15,918,742 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionVB vs. C# Pin
medicenpringles28-Sep-05 7:37
medicenpringles28-Sep-05 7:37 
AnswerRe: VB vs. C# Pin
Dave Kreskowiak28-Sep-05 8:44
mveDave Kreskowiak28-Sep-05 8:44 
AnswerRe: VB vs. C# Pin
Mike Hodnick28-Sep-05 10:14
Mike Hodnick28-Sep-05 10:14 
GeneralRe: VB vs. C# Pin
Dave Kreskowiak28-Sep-05 17:13
mveDave Kreskowiak28-Sep-05 17:13 
GeneralRe: VB vs. C# Pin
rwestgraham28-Sep-05 17:39
rwestgraham28-Sep-05 17:39 
QuestionOpen and close a PDF document Pin
necao28-Sep-05 6:01
necao28-Sep-05 6:01 
AnswerRe: Open and close a PDF document Pin
Dave Kreskowiak28-Sep-05 7:18
mveDave Kreskowiak28-Sep-05 7:18 
QuestionHow to monitor file time stamp for changes Pin
CamToo28-Sep-05 5:59
CamToo28-Sep-05 5:59 
I've written a short procedure intended to "watch" for changes to a specific file's time stamp. I've tried FileSystemWatcher.NotifyFilter.LastAccess and it only reads changes to Date, not Time.

This code is very cumbersome, inelegant mostly due to the DO . . LOOP which runs constantly.

Is there a simpler, cleaner way to do the same thing?

Imports System
Imports System.IO
Public Class Watcher
Public Shared Sub Main()
Dim filepath As String = "C:\Documents and Settings\ballcx\My Documents\My Music\tada.wav"
File.SetLastAccessTime(filepath, New DateTime(1985, 5, 4, 0, 0, 0))
Dim ot As DateTime = File.GetLastAccessTime(filepath)
Dim nt As DateTime = File.GetLastAccessTime(filepath)
Dim Ctr As Integer = 0
Dim diff As TimeSpan
Dim diff_min As Integer
' Begin watching.
Do While ot <> #12:00:00 AM#
nt = File.GetLastAccessTime(filepath)
If nt <> ot Then
diff = nt.Subtract(ot)
diff_min = diff.Minutes
If diff_min > 2 Then MsgBox(nt)
ot = nt
End If
Loop
End Sub
AnswerRe: How to monitor file time stamp for changes Pin
Dave Kreskowiak28-Sep-05 7:00
mveDave Kreskowiak28-Sep-05 7:00 
QuestionMaintaining an inherited VB6 application Pin
StrayGrey28-Sep-05 5:50
StrayGrey28-Sep-05 5:50 
AnswerRe: Maintaining an inherited VB6 application Pin
Dave Kreskowiak28-Sep-05 6:34
mveDave Kreskowiak28-Sep-05 6:34 
GeneralRe: Maintaining an inherited VB6 application Pin
StrayGrey28-Sep-05 6:57
StrayGrey28-Sep-05 6:57 
GeneralRe: Maintaining an inherited VB6 application Pin
Dave Kreskowiak28-Sep-05 7:07
mveDave Kreskowiak28-Sep-05 7:07 
QuestionVB.Net,C# and SQL DB Script Pin
| Muhammad Waqas Butt |28-Sep-05 5:42
professional| Muhammad Waqas Butt |28-Sep-05 5:42 
AnswerRe: VB.Net,C# and SQL DB Script Pin
Dave Kreskowiak28-Sep-05 7:26
mveDave Kreskowiak28-Sep-05 7:26 
QuestionCase sensitive problem Pin
PHDENG8128-Sep-05 3:39
PHDENG8128-Sep-05 3:39 
AnswerRe: Case sensitive problem Pin
Dave Kreskowiak28-Sep-05 5:23
mveDave Kreskowiak28-Sep-05 5:23 
QuestionOpening an Program by clicking on file Pin
ciacia28-Sep-05 0:24
ciacia28-Sep-05 0:24 
AnswerRe: Opening an Program by clicking on file Pin
enjoycrack28-Sep-05 0:53
enjoycrack28-Sep-05 0:53 
GeneralRe: Opening an Program by clicking on file Pin
ciacia29-Sep-05 1:43
ciacia29-Sep-05 1:43 
QuestionAdd image to richtextbox Pin
Greeky27-Sep-05 21:58
Greeky27-Sep-05 21:58 
QuestionSave RTF Pin
Greeky27-Sep-05 21:48
Greeky27-Sep-05 21:48 
AnswerRe: Save RTF Pin
Dave Kreskowiak28-Sep-05 1:34
mveDave Kreskowiak28-Sep-05 1:34 
QuestionUpdating datasource through dataset and dataadapter Pin
Priya Haridas27-Sep-05 16:35
Priya Haridas27-Sep-05 16:35 
QuestionHow to parse a string with double quotes Pin
j1webb27-Sep-05 9:43
j1webb27-Sep-05 9:43 

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.