Location of user files with a ClickOnce application

China☆狼群 提交于 2019-12-05 15:12:17

ok, I eventually found a code snippet that helped me out. The xml files were already being put into the ClickOnce "data directory" (this can be configured using the "application files" button on the publish tab of the project settings dialog. Then you can get at the data directory as follows:

    private string GetDataDirectory()
    {
        if (ApplicationDeployment.IsNetworkDeployed)
        {
            return ApplicationDeployment.CurrentDeployment.DataDirectory;
        }
        else
        {
            return Application.StartupPath;
        }
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!