English 中文(简体)
书写数据夹——许可问题?
原标题:Writing to appdata folder - permission issue?

我对类似问题的一些答案有点放矢,但并没有真正帮助我。

我有一封信,我寄出一些资源。 在启动评估时,要了解数据夹中是否有资源,如果没有将模板档案从嵌入的资源中复制到数据夹,然后将数据夹中的模板作为工作复印件。

我有一个助手班,除其他外,将数据和资源重归如下:

class Folders
{
    static public String GetUserFolder()
    {
        return Application.LocalUserAppDataPath;
    }

    static public String GetResourcesFolder()
    {
        // If the resources folder does not exist then create it
        String userFolder = GetUserFolder();
        String resourcesFolder = userFolder + "\Resources";

        if (!Directory.Exists(resourcesFolder))
        {
            Directory.CreateDirectory(resourcesFolder);
        }
        return resourcesFolder;
    }

    ...

因此,我的法典把“GetResourcesFolder”方法称作“返回道路”(如果需要,在这一过程中打上双手)检查,看档案是否存在,以及它是否试图用诸如下列内容书写:

        String filename = Helpers.IO.Folders.GetResourcesFolder() + "\data.dat";
        FileStream outFile = System.IO.File.OpenWrite(filename);

因此,我已经清点了现场,该法典正在开发办公室的所有机器上工作。 然而,几个场外的同事抱怨说,他们的机器——每台XP机器——但却没有从他们那里得到很多有用的信息——试图从他们那里获取更多的信息。 我在办公室拥有XP机器,在办公室工作时没有问题。

此前,我挖出一些“陈旧”的真菌机,并设法在两台Xp(分机)上坠毁。 两次坠毁似乎都与书面许可和用“Run As.”处理问题并正确执行有关。 然而,一旦 app机停止坠毁,即使我删除从数据夹中产生的档案/文件,即使我不提高许可,它仍会成功地处理随后的处决。

我面临的问题是,我现在不能再重复我所能使用的任何杰夫机器的坠毁,我不知道如何把机器带回我能够使用的国家。

任何人都想到会给问题带来什么,或我如何能够将机器退回到“虚拟”状态,以便能够重复坠毁,帮助我跟踪坠毁。

问题回答

One course of action is to create a Virtual Machine of XP. You can save the state of the machine before install for testing. After your install just revert back to the previous state to test again. There are a few Vendors with free Virtual Machines:

http://www.microsoft.com/windows/virtual-pc/

https://www.virtual Box.org/

同相关问题本身一样,我不知道在虚拟机器上安装用于测试目的的甚低频设备。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签