Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Broken code - UAC related?

  1. Oct 30, 2008 #1

    CRGreathouse

    User Avatar
    Science Advisor
    Homework Helper

    Broken code -- UAC related?

    Here's the code I'm having trouble with, cut down the relevant part:

    Code (Text):
    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.
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you help with the solution or looking for help too?
Draft saved Draft deleted



Similar Discussions: Broken code - UAC related?
  1. Huffman Code. (Replies: 4)

  2. Error in code (Replies: 4)

  3. Examples of code (Replies: 2)

  4. Code Blocks (Replies: 2)

  5. The Source Code! (Replies: 15)

Loading...