Click here to Skip to main content

Visual Basic

 
AnswerRe: Rijndael encryption not working PinmentorKeith Barrow14-Nov-12 3:52 
GeneralRe: Rijndael encryption not working Pinmembermaskrtnik0114-Nov-12 4:08 
GeneralRe: Rijndael encryption not working PinmentorKeith Barrow14-Nov-12 4:26 
GeneralRe: Rijndael encryption not working PinmentorKeith Barrow14-Nov-12 4:35 
GeneralRe: Rijndael encryption not working Pinmembermaskrtnik0114-Nov-12 4:48 
GeneralRe: Rijndael encryption not working PinmentorKeith Barrow14-Nov-12 5:05 
QuestionRe: Rijndael encryption not working [modified] Pinmembermaskrtnik0115-Nov-12 20:40 
GeneralRe: Rijndael encryption not working PinmemberDisIsHoody14-Nov-12 10:34 
GeneralRe: Rijndael encryption not working Pinmembermaskrtnik0114-Nov-12 19:21 
AnswerRe: Rijndael encryption not working PinmemberDisIsHoody15-Nov-12 18:37 
GeneralRe: Rijndael encryption not working Pinmembermaskrtnik0115-Nov-12 20:37 
QuestionRetrive date from sql server in system date format in VB6 application by a one time setting PinmemberJohnson Antony13-Nov-12 14:34 
AnswerRe: Retrive date from sql server in system date format in VB6 application by a one time setting PinmvpDave Kreskowiak13-Nov-12 15:00 
QuestionHow to find out if a file is in use before reading the data in that file PinmemberKreativeKai13-Nov-12 8:47 
Hi all,
We have a financial system that writes a text file out that could be several 100 or even 1000 lines long. It writes the file into a txt file and can't be modified to be another file extension and then be renamed after the data has been loaded.
 
I have a service already written that notices that a txt file has shown up in this directory and fires off the application that needs to read this data.
 
I don't want to have the application which reads the data begin the process until after the financial system has written all data to the file.
 
I've searched all kinds of VB help sites and here is the code most refer to in various ways:

Public Function IsFileLocked(filename As String) As Boolean
Dim Locked As Boolean = False
Try
Dim fs As FileStream = File.Open(filename, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None)
fs.Close()
Catch ex As IOException
Locked = True
End Try
Return Locked
End Function

 
I have my file open in Notepad to test and have the file being accessed, but it falls straight through the code and does not hit the catch. I even opened the file in Excel and had the same result.
 
Any ideas?
Confused | :confused:
Lost in the vast sea of .NET

AnswerRe: How to find out if a file is in use before reading the data in that file PinmvpDave Kreskowiak13-Nov-12 9:09 
GeneralRe: How to find out if a file is in use before reading the data in that file PinmemberKreativeKai13-Nov-12 9:22 
GeneralRe: How to find out if a file is in use before reading the data in that file PinmemberKreativeKai13-Nov-12 9:46 
AnswerRe: How to find out if a file is in use before reading the data in that file PinmemberKreativeKai13-Nov-12 9:13 
GeneralRe: How to find out if a file is in use before reading the data in that file [modified] PinmvpDave Kreskowiak13-Nov-12 10:57 
AnswerRe: How to find out if a file is in use before reading the data in that file PinmemberEddy Vluggen13-Nov-12 12:41 
GeneralRe: How to find out if a file is in use before reading the data in that file PinmemberKreativeKai14-Nov-12 2:37 
GeneralRe: How to find out if a file is in use before reading the data in that file [modified] PinmemberVitorHugoGarcia19-Nov-12 2:12 
QuestionVB Script for automatically turning off the monitor PinmemberPrasan Cumar13-Nov-12 5:14 
AnswerRe: VB Script for automatically turning off the monitor PinmvpDave Kreskowiak13-Nov-12 5:59 
AnswerRe: VB Script for automatically turning off the monitor PinmemberBernhard Hiller13-Nov-12 22:20 
QuestionSQL Configuration PinmemberDinoRondelly13-Nov-12 4:46 
AnswerRe: SQL Configuration PinmemberDavid Mujica13-Nov-12 5:07 
GeneralRe: SQL Configuration PinmemberDinoRondelly13-Nov-12 6:56 
GeneralRe: SQL Configuration PinmemberDavid Mujica13-Nov-12 10:44 
GeneralRe: SQL Configuration PinmemberDinoRondelly13-Nov-12 19:17 
QuestionSource Code PinmemberMember 939009712-Nov-12 16:59 
AnswerRe: Source Code PinmvpDave Kreskowiak13-Nov-12 3:20 
QuestionMonitoring Network Usage For Remote Users [modified] PinmemberDinoRondelly12-Nov-12 11:54 
AnswerRe: Monitoring Network Usage For Remote Users PinmemberEddy Vluggen13-Nov-12 12:44 
QuestionScan Multipage Tiff Image For A Barcode Pinmemberdaveofgv12-Nov-12 5:07 
AnswerRe: Scan Multipage Tiff Image For A Barcode PinmemberEddy Vluggen12-Nov-12 11:54 
QuestionGetting All Logged On Users and IP VB.net PinmemberDinoRondelly12-Nov-12 4:39 
AnswerRe: Getting All Logged On Users and IP VB.net PinmvpDave Kreskowiak12-Nov-12 5:37 
GeneralRe: Getting All Logged On Users and IP VB.net PinmemberDinoRondelly12-Nov-12 5:44 
GeneralRe: Getting All Logged On Users and IP VB.net PinmvpDave Kreskowiak12-Nov-12 5:52 
GeneralRe: Getting All Logged On Users and IP VB.net PinmemberDinoRondelly12-Nov-12 5:55 
GeneralRe: Getting All Logged On Users and IP VB.net PinmvpDave Kreskowiak12-Nov-12 6:55 
GeneralRe: Getting All Logged On Users and IP VB.net PinmemberDinoRondelly12-Nov-12 7:11 
GeneralRe: Getting All Logged On Users and IP VB.net PinmvpDave Kreskowiak12-Nov-12 7:46 
AnswerRe: Getting All Logged On Users and IP VB.net [modified] PinmemberDinoRondelly12-Nov-12 9:05 
GeneralRe: Getting All Logged On Users and IP VB.net PinmvpDave Kreskowiak12-Nov-12 11:02 
QuestionModule error> PLEASE HELP! Pinmemberleashim11-Nov-12 14:57 
AnswerRe: Module error> PLEASE HELP! PinmvpDave Kreskowiak11-Nov-12 18:08 
QuestionPizza order form PinmemberRitchie Vasquez11-Nov-12 6:59 
AnswerRe: Pizza order form PinmvpRichard MacCutchan11-Nov-12 7:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 30 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid