- #1
- 2,845
- 0
Broken code -- UAC related?
Here's the code I'm having trouble with, cut down the relevant part:
The "output filename ok" dialog comes up, but then nothing. The program doesn't crash, the exception doesn't occur, the "sw setup" dialog doesn't appear.
The output filename, for what it's worth, is in the user's AppData folder, so I don't think this should be a problem even with Vista's UAC, but I might be missing something obvious.
Here's the code I'm having trouble with, cut down the relevant part:
Code:
protected void ProcessFiles(string[] files)
{
if (File.Exists(outputFilename))
throw new Exception("Output file " + outputFilename + " already exists!");
if (Directory.Exists(direc(outputFilename)))
throw new Exception("Output file directory " + direc(outputFilename) + " does not exist!");
MessageBox.Show("output filename ok");
StreamWriter sw;
try
{
sw = new StreamWriter(outputFilename);
}
catch
{
throw new Exception("Unspecified error");
}
MessageBox.Show("sw setup");
// . . .
The "output filename ok" dialog comes up, but then nothing. The program doesn't crash, the exception doesn't occur, the "sw setup" dialog doesn't appear.
The output filename, for what it's worth, is in the user's AppData folder, so I don't think this should be a problem even with Vista's UAC, but I might be missing something obvious.