如何在asp.net中将字符串变量值保存为文本文件 [英] how to save string variable value as text file in asp.net

查看:243
本文介绍了如何在asp.net中将字符串变量值保存为文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将加密文本保存为字符串变量...我想将这些变量保存为我在asp.net中的本地磁盘中的文本文件....我尝试编写文本文件但是收到此错误 c:/cloud/file.txt - 不是虚拟路径

i have saved encrypted text as string variable...i wanna to save those variable as text file in my local disk in asp.net....i try to write text file but getting this error"c:/cloud/file.txt -not a virtual path"

推荐答案

硬编码任何路径都没有任何情况应用程序中的名称可能很有用。在所有编程中,一般而言。现在,对于ASP.NET或任何其他服务器端HTTP服务器技术,这是特别糟糕的事情:Web应用程序在这样的沙盒环境中执行,在该环境中无法访问代表该站点的子目录之外的任何文件。的根源。你根本就没有获得这样做的权限。出于一些非常好的理由。



-SA
There are no situations when hard-coding any path names in the application can be useful. In all programming, in general. Now, as to ASP.NET or any other server-side HTTP server technology, this is especially bad thing: the Web applications are executed in such a sandboxed environment where it is impossible to access any files beyond the sub-directory representing the site''s root. You simply won''t get permissions for doing so. For some very good reasons.

—SA


这篇关于如何在asp.net中将字符串变量值保存为文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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