MSI软件包的Strmwrtie和strmread问题 [英] Strmwrtie&strmread problems with MSI package

查看:155
本文介绍了MSI软件包的Strmwrtie和strmread问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我需要这些问题的帮助,我使简单的App可以从文件中读取和写入数据,它可以在发布和调试时与我一起工作,但是当我在Visual Studio上安装安装程序包时,这些功能将不起作用并使App崩溃,那么这个问题有什么解决方案吗?
我知道问题在哪里,StrmWrtie& StrmRead,但我不知道为什么会这样?什么是解决方案

Hi Every One
I want some help for these problems , I make simple App read and write data from file , it is working with me in release and debug mood but when i make Setup package on Visual Studio , these Functions don''t work and make App crash , so is there any solutions for this problem ?
I know the problem where is , StrmWrtie&StrmRead but i don''t know why is it happen ? and what is the solution

private void button1_Click(object sender, EventArgs e)
{
    string textbox1 = textBox1.Text;
    StreamWriter ss = new StreamWriter(Application.ExecutablePath+"test.text");
    ss.WriteLine(textbox1);
    ss.Dispose();
    MessageBox.Show("Write is Done");
    StreamReader sss = new StreamReader(Application.ExecutablePath + "test.text");
    string textbox2=sss.ReadLine();
    textBox2.Text = textbox2;
}



我尝试过的事情:

堆栈Ovrflow,MSDN,CodeProject



What I have tried:

Stack Ovrflow , MSDN , CodeProject

推荐答案

简单:您不将数据存储在应用程序文件夹中,因为在生产中它通常位于"Program Files"文件夹下-并出于安全原因对其进行了限制.
而是使用批准的"位置之一存储信息:我应该在哪里存储我的数据? [ ^ ]
Simple: you don''t store data in your application folder because in production it is generally under the "Program Files" folder - and access to that is restricted for security reasons.
Instead, use one of the "approved" places to store information: Where should I store my data?[^]


这篇关于MSI软件包的Strmwrtie和strmread问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆