Click here to Skip to main content
15,915,663 members
Home / Discussions / C#
   

C#

 
GeneralSerialization over socket Pin
iGN10-Jul-02 6:05
iGN10-Jul-02 6:05 
GeneralPlease...Help...Question about checking/unchecking boxes Pin
cAptHiDDeN10-Jul-02 5:28
cAptHiDDeN10-Jul-02 5:28 
GeneralDatabase Problem Pin
BHBAD10-Jul-02 4:26
sussBHBAD10-Jul-02 4:26 
GeneralRe: Database Problem Pin
Mazdak10-Jul-02 9:14
Mazdak10-Jul-02 9:14 
GeneralRe: Database Problem Pin
Steve Severance10-Jul-02 10:49
Steve Severance10-Jul-02 10:49 
GeneralDragDrop inTree View Pin
Member 1697710-Jul-02 2:22
Member 1697710-Jul-02 2:22 
GeneralRe: DragDrop inTree View Pin
Bill Dean4-Sep-02 11:30
Bill Dean4-Sep-02 11:30 
QuestionAn unhandled exception? Pin
hunglin9-Jul-02 20:38
hunglin9-Jul-02 20:38 
My program "A" connect to a database, and write data to a xml file.

///////my code
this.myDataSet.WriteXml("test.xml",XmlWriteMode.IgnoreSchema);
StreamWriter xmlsw = new StreamWriter("test.xml",false);
this.myDataSet.WriteXml(xmlsw,XmlWriteMode.IgnoreSchema);
xmlsw.Close();
///////

And I have another program "B" will access test.xml every 30 sec. Sometime the program "A" will cause an unhandled exception like this:

//error message
An unhandled exception has occurred in your application. If you click Continue,the application will ignore this error and attempt to continue. If you click Quit, the application will be shut shut down immediately.

The process cannot access the file "test.xml" because it is being used by another process.
/////

My question is :
1. How can I check the file is access by another program before writing data to this file.
2. Or, How can I ignore this message automatically.

thanks.
AnswerRe: An unhandled exception? Pin
Andres Manggini10-Jul-02 10:14
Andres Manggini10-Jul-02 10:14 
GeneralAccessing position of desktop icons... Pin
gekoscan9-Jul-02 8:19
gekoscan9-Jul-02 8:19 
GeneralAmazon UK and Inside C# Pin
Michael P Butler9-Jul-02 8:17
Michael P Butler9-Jul-02 8:17 
GeneralRe: Amazon UK and Inside C# Pin
merlin987610-Jul-02 16:57
merlin987610-Jul-02 16:57 
GeneralRe: Amazon UK and Inside C# Pin
Christian Graus10-Jul-02 18:28
protectorChristian Graus10-Jul-02 18:28 
GeneralThe "good books" question... Pin
merlin98769-Jul-02 7:54
merlin98769-Jul-02 7:54 
GeneralRe: The "good books" question... Pin
Michael P Butler9-Jul-02 8:13
Michael P Butler9-Jul-02 8:13 
GeneralRe: The "good books" question... Pin
Eric Gunnerson (msft)10-Jul-02 7:42
Eric Gunnerson (msft)10-Jul-02 7:42 
GeneralRe: The "good books" question... Pin
merlin987610-Jul-02 16:54
merlin987610-Jul-02 16:54 
GeneralRe: The "good books" question... Pin
James T. Johnson10-Jul-02 21:03
James T. Johnson10-Jul-02 21:03 
GeneralRe: The "good books" question... Pin
Eric Gunnerson (msft)11-Jul-02 7:09
Eric Gunnerson (msft)11-Jul-02 7:09 
QuestionBUG? Pin
leppie9-Jul-02 4:14
leppie9-Jul-02 4:14 
AnswerRe: BUG? Pin
Eric Gunnerson (msft)10-Jul-02 7:39
Eric Gunnerson (msft)10-Jul-02 7:39 
GeneralRe: BUG? Pin
leppie10-Jul-02 20:33
leppie10-Jul-02 20:33 
GeneralLinks to C# sites Pin
leppie8-Jul-02 23:38
leppie8-Jul-02 23:38 
GeneralRe: Links to C# sites Pin
Michael P Butler9-Jul-02 8:20
Michael P Butler9-Jul-02 8:20 
GeneralCreating similar Shell_TrayWnd Pin
8-Jul-02 21:02
suss8-Jul-02 21:02 

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.