Coding Thread, A VB.net Program i don't have a Clue how todo! in Coding and Web Development; Hi everyone.
first of all. let me explain my situation.. we have our exchange do an automatic backup to our ...
I'm very rusty on VB, I'm afraid but I can tell you that you're probably looking for DateTime.Compare. You could do something like this:
Dim file1 As New System.IO.FileInfo("yourfilepath")
Dim result As Integer
result = DateTime.Compare(file1.LastModified, DateTime.Date)
If result is 0, there's no difference. If it's less than 0, dt1 is earlier than dt2 and if it's greater than 0, dt1 is later than dt2. If that code doesn't work, someone who's actually written some VB in the last year might be able to do something with it.
Last edited by bizzel; 28th March 2008 at 10:05 AM.
The problem i seem to be having is stripping the time off the end of the string.. if i can get rid of that.. i will be able to do this!
its complaing about some sort of bloody access rights now aswell i can't even retreave the RAW data infomation and output it as a msgbox, let alone put it down to a string and remove the crap on the end..
This is the error im currently having, i stripped out all the caparison code, and just got it to output into a MSGBOX but i keep getting this error. and as usual, microsoft help is no help!
screenshot should(first time using uploaded) attatched..
"My Computer" could be a problem considering the file is on some other computer. Get rid of that and try it the System.IO.FileInfo way bizzel mention back in March.
Basically, that error boils down to "nuh uh, I don't have permission to access that item", which could be a lot of things. In this case, it's telling you that it doesn't have permission to read. Assuming that you can access the file with explorer, I'd give System.IO.FileInfo a spin and see if that changes anything.