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

C#

 
AnswerRe: com add in excel2010 Pin
Abhinav S11-Feb-12 5:08
Abhinav S11-Feb-12 5:08 
GeneralRe: com add in excel2010 Pin
PozzaVecia11-Feb-12 5:31
PozzaVecia11-Feb-12 5:31 
GeneralRe: com add in excel2010 Pin
Abhinav S11-Feb-12 17:04
Abhinav S11-Feb-12 17:04 
GeneralRe: com add in excel2010 Pin
PozzaVecia11-Feb-12 6:09
PozzaVecia11-Feb-12 6:09 
Questionocr from japenese to english using c# with MODI Pin
udayakumard10-Feb-12 23:21
udayakumard10-Feb-12 23:21 
AnswerRe: ocr from japenese to english using c# with MODI Pin
Dave Kreskowiak11-Feb-12 2:08
mveDave Kreskowiak11-Feb-12 2:08 
QuestionAccess is denied Pin
jon-8010-Feb-12 22:29
professionaljon-8010-Feb-12 22:29 
AnswerRe: Access is denied Pin
fjdiewornncalwe11-Feb-12 5:40
professionalfjdiewornncalwe11-Feb-12 5:40 
It appears that your application which resides in the ...\bin\debug directory is attempting to create the folder in which it resides.
The key is in your error message. Cout not create output directory.
My suspicion is that you are using Directory.CreateDirectory instead of File.Create.
If you are using the sample from MSDN (http://msdn.microsoft.com/en-us/library/as2f1fez.aspx[^])
The safe way to do this is to always check if an object already exists before trying to create it.
C#
if(!Directory.Exists "your directory path"))
{
   Directory.CreateDirectory("your path");
}

// There are multiple ways to do this part...
// 1 way - This way will open the file if it exist, but create a new one if it doesn't.
FileStream fs;
if(!File.Exists("your file path"))
{
   fs = File.Create("your file path");
}
else
{
   fs = new FileStream("your file path", FileMode.Open);
}

// A 2nd way - This one will delete the existing file and let you start off with a new file.
if(File.Exists("your file path"))
{
   File.Delete("your file path");
}

using(FileStream fs = File.Create("your file path"))
{
   ... Write stuff to the file here
}

using (FileStream fs = File.OpenRead(path))
{
   ... Read the contents of the file here
}


This MSDN FileStream[^] library article is a very good one to learn from.
I wasn't, now I am, then I won't be anymore.

QuestionWriting to an excel file Pin
JFRobertson10-Feb-12 20:12
JFRobertson10-Feb-12 20:12 
AnswerRe: Writing to an excel file Pin
Richard MacCutchan10-Feb-12 23:48
mveRichard MacCutchan10-Feb-12 23:48 
GeneralRe: Writing to an excel file Pin
JFRobertson11-Feb-12 8:08
JFRobertson11-Feb-12 8:08 
GeneralRe: Writing to an excel file Pin
Richard MacCutchan11-Feb-12 23:32
mveRichard MacCutchan11-Feb-12 23:32 
GeneralRe: Writing to an excel file Pin
Richard MacCutchan12-Feb-12 1:13
mveRichard MacCutchan12-Feb-12 1:13 
GeneralRe: Writing to an excel file Pin
JFRobertson12-Feb-12 8:49
JFRobertson12-Feb-12 8:49 
QuestionRe: Writing to an excel file Pin
Richard MacCutchan12-Feb-12 9:07
mveRichard MacCutchan12-Feb-12 9:07 
GeneralRe: Writing to an excel file Pin
BobJanova12-Feb-12 22:44
BobJanova12-Feb-12 22:44 
GeneralRe: Writing to an excel file Pin
Richard MacCutchan12-Feb-12 23:02
mveRichard MacCutchan12-Feb-12 23:02 
QuestionWhy IsBetweenLabels property only works for AxysType Text? Pin
Thiago Marçal10-Feb-12 8:04
Thiago Marçal10-Feb-12 8:04 
QuestionText Editor Pin
jeramyRR10-Feb-12 6:41
jeramyRR10-Feb-12 6:41 
AnswerRe: Text Editor Pin
Eddy Vluggen10-Feb-12 6:52
professionalEddy Vluggen10-Feb-12 6:52 
GeneralRe: Text Editor Pin
jeramyRR10-Feb-12 7:15
jeramyRR10-Feb-12 7:15 
QuestionGenerating html tree from xml file using XSLT..? Pin
anikbutt2210-Feb-12 6:16
anikbutt2210-Feb-12 6:16 
AnswerRe: Generating html tree from xml file using XSLT..? Pin
jschell10-Feb-12 9:24
jschell10-Feb-12 9:24 
GeneralRe: Generating html tree from xml file using XSLT..? Pin
anikbutt2210-Feb-12 14:18
anikbutt2210-Feb-12 14:18 
GeneralRe: Generating html tree from xml file using XSLT..? Pin
jschell12-Feb-12 7:31
jschell12-Feb-12 7:31 

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.