Click here to Skip to main content
15,910,980 members
Home / Discussions / C#
   

C#

 
GeneralRe: decide whether to split string or not Pin
Mairaaj Khan1-Jun-06 0:03
professionalMairaaj Khan1-Jun-06 0:03 
GeneralRe: decide whether to split string or not Pin
_AK_1-Jun-06 0:05
_AK_1-Jun-06 0:05 
Question<b>encrypt password to a binary format</b> Pin
mex2331-May-06 23:30
mex2331-May-06 23:30 
AnswerRe: encrypt password to a binary format Pin
LongRange.Shooter1-Jun-06 9:26
LongRange.Shooter1-Jun-06 9:26 
QuestionWriting to/creating a file in remote server Pin
emran83431-May-06 23:06
emran83431-May-06 23:06 
AnswerRe: Writing to/creating a file in remote server Pin
LongRange.Shooter1-Jun-06 9:30
LongRange.Shooter1-Jun-06 9:30 
QuestionMessage Box Pin
Rahul.RK31-May-06 22:57
Rahul.RK31-May-06 22:57 
AnswerRe: Message Box Pin
InOut.NET31-May-06 23:05
InOut.NET31-May-06 23:05 
AnswerRe: Message Box Pin
LongRange.Shooter1-Jun-06 9:32
LongRange.Shooter1-Jun-06 9:32 
QuestionWindows ding on textbox Pin
InOut.NET31-May-06 21:59
InOut.NET31-May-06 21:59 
AnswerRe: Windows ding on textbox Pin
Mairaaj Khan31-May-06 23:57
professionalMairaaj Khan31-May-06 23:57 
GeneralRe: Windows ding on textbox Pin
InOut.NET1-Jun-06 0:06
InOut.NET1-Jun-06 0:06 
AnswerRe: Windows ding on textbox Pin
Christian Wulff1-Jun-06 0:57
Christian Wulff1-Jun-06 0:57 
GeneralRe: Windows ding on textbox Pin
InOut.NET1-Jun-06 21:33
InOut.NET1-Jun-06 21:33 
QuestionCopy or read locked/in use files Pin
nemopeti31-May-06 21:15
nemopeti31-May-06 21:15 
Hi for all!

I have some problem, while try to read and copy locked or files witch in use.
I try this method, witch work for some file, but the others not D'Oh! | :doh:

my way:
<br />
FileStream fs = null;<br />
<br />
                        try<br />
                        {<br />
                            try<br />
                            {<br />
                                fs = File.OpenRead(file);<br />
                            }<br />
                            catch<br />
                            {<br />
                                fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);<br />
                            }<br />
                        }<br />
                        catch<br />
                        {<br />
                            try<br />
                            {<br />
                                string NewFile=File+"_";<br />
                                Fi.CopyTo(NewFile, true);<br />
                                    }<br />
                                    catch<br />
                                    {<br />
                                        try<br />
                                        {<br />
                                            File.Copy(file, NewFile, true);<br />
                                        }<br />
                                        catch<br />
                                        {<br />
                                        }<br />
                                    }<br />
                                }                                <br />
                            }<br />
                            catch (Exception e)<br />
                            {<br />
                                MessageBox.Show("Grrrrrr: "+e.Message);<br />
                            }<br />


I miss somethink, or I need a nother way to figure out windows file locking system.

I wait for any ideas....

Thank's for help.
AnswerRe: Copy or read locked/in use files Pin
stancrm31-May-06 21:30
stancrm31-May-06 21:30 
GeneralRe: Copy or read locked/in use files Pin
nemopeti31-May-06 21:34
nemopeti31-May-06 21:34 
GeneralRe: Copy or read locked/in use files Pin
stancrm31-May-06 21:50
stancrm31-May-06 21:50 
GeneralRe: Copy or read locked/in use files Pin
nemopeti31-May-06 23:41
nemopeti31-May-06 23:41 
GeneralRe: Copy or read locked/in use files Pin
stancrm31-May-06 23:47
stancrm31-May-06 23:47 
GeneralRe: Copy or read locked/in use files Pin
nemopeti31-May-06 23:54
nemopeti31-May-06 23:54 
QuestionIs it a correct way Pin
engsrini31-May-06 20:43
engsrini31-May-06 20:43 
AnswerRe: Is it a correct way Pin
BadKarma31-May-06 21:33
BadKarma31-May-06 21:33 
AnswerRe: Is it a correct way Pin
InOut.NET31-May-06 21:57
InOut.NET31-May-06 21:57 
Questioncombobox Pin
kjosh31-May-06 20:28
kjosh31-May-06 20:28 

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.