Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
GeneralRe: Spinning Roulette Wheel Pin
stephen.darling15-Sep-11 4:34
stephen.darling15-Sep-11 4:34 
QuestionComparing 2 lists Pin
nitin_ion8-Sep-11 3:12
nitin_ion8-Sep-11 3:12 
AnswerRe: Comparing 2 lists Pin
PIEBALDconsult8-Sep-11 3:15
mvePIEBALDconsult8-Sep-11 3:15 
AnswerRe: Comparing 2 lists Pin
BobJanova8-Sep-11 3:29
BobJanova8-Sep-11 3:29 
AnswerRe: Comparing 2 lists Pin
Wayne Gaylard8-Sep-11 4:08
professionalWayne Gaylard8-Sep-11 4:08 
AnswerRe: Comparing 2 lists Pin
Daniel.Grondal8-Sep-11 21:46
Daniel.Grondal8-Sep-11 21:46 
QuestionUploading already use file Pin
sarang_k8-Sep-11 1:34
sarang_k8-Sep-11 1:34 
AnswerRe: Uploading already use file Pin
BobJanova8-Sep-11 1:49
BobJanova8-Sep-11 1:49 
If another application has the file open, and locked for reading, you cannot read from it. That's an OS level restriction. You can give yourself a chance by requesting a read-sharable lock to the file yourself:
FileStream fs = File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.Read);

This will succeed where an attempt to open the file read/write won't if another application has done the same thing. However, most applications lock files completely while in use (and some, notably MS Office, keep the file locked while it is open ... bad practice, that), and there is simply no way to read such a file while the other application has it open.

Check that your own application isn't opening a file and forgetting to close it, though. That's a good way of creating this exception that can be fixed. You can generally put a FileStream or StreamReader in a using block which makes sure it is always closed.
GeneralRe: Uploading already use file Pin
sarang_k8-Sep-11 2:11
sarang_k8-Sep-11 2:11 
GeneralRe: Uploading already use file Pin
MicroVirus8-Sep-11 5:00
MicroVirus8-Sep-11 5:00 
GeneralRe: Uploading already use file Pin
BobJanova8-Sep-11 6:12
BobJanova8-Sep-11 6:12 
GeneralRe: Uploading already use file Pin
Eddy Vluggen8-Sep-11 6:53
professionalEddy Vluggen8-Sep-11 6:53 
GeneralRe: Uploading already use file Pin
BobJanova8-Sep-11 10:25
BobJanova8-Sep-11 10:25 
GeneralRe: Uploading already use file Pin
Eddy Vluggen8-Sep-11 10:34
professionalEddy Vluggen8-Sep-11 10:34 
GeneralRe: Uploading already use file Pin
MicroVirus8-Sep-11 13:07
MicroVirus8-Sep-11 13:07 
QuestionDirectShowNET Framework 4.0 and 2.0 Pin
semixor8-Sep-11 1:10
semixor8-Sep-11 1:10 
AnswerRe: DirectShowNET Framework 4.0 and 2.0 Pin
Eddy Vluggen8-Sep-11 7:00
professionalEddy Vluggen8-Sep-11 7:00 
GeneralRe: DirectShowNET Framework 4.0 and 2.0 Pin
semixor8-Sep-11 9:01
semixor8-Sep-11 9:01 
AnswerRe: DirectShowNET Framework 4.0 and 2.0 Pin
Eddy Vluggen8-Sep-11 9:11
professionalEddy Vluggen8-Sep-11 9:11 
QuestionIBasicVideo + NullRenderer ( How ? ) Pin
semixor8-Sep-11 0:50
semixor8-Sep-11 0:50 
AnswerRe: IBasicVideo + NullRenderer ( How ? ) Pin
MicroVirus8-Sep-11 4:49
MicroVirus8-Sep-11 4:49 
GeneralRe: IBasicVideo + NullRenderer ( How ? ) Pin
semixor8-Sep-11 5:52
semixor8-Sep-11 5:52 
GeneralRe: IBasicVideo + NullRenderer ( How ? ) Pin
MicroVirus8-Sep-11 13:28
MicroVirus8-Sep-11 13:28 
GeneralRe: IBasicVideo + NullRenderer ( How ? ) Pin
semixor9-Sep-11 3:20
semixor9-Sep-11 3:20 
QuestionDeep Linking between views when using PRISM Pin
Phillip Donegan7-Sep-11 21:46
Phillip Donegan7-Sep-11 21:46 

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.