用C#/ Asp.net打开文件 [英] Open File With C# / Asp.net

查看:65
本文介绍了用C#/ Asp.net打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,

我在ASP.Net/C#应用程序中打开文件时遇到了一些麻烦。

我有一个文件路径和名称存储在我的数据库。我在Gridview控件中显示该文件名。我还在文件名旁边有一个按钮,用于在记事本中打开文件。这是代码。

Hello All,
I am having a bit of trouble opening a file in my ASP.Net/C# Application.
I have a file Path and name stored in my Database. I display that filename in a Gridview control. I also have a Button next to the File name that i use to open the file in notepad. Here is that code.

展开 | 选择 | Wrap | 行号

推荐答案

您确认记事本确实存在于假设在服务器上的位置?


如果它是一个64位操作系统,那么这不是记事本所在的位置。

我不确定记事本的位置在像WinServer2003 / 5/8这样的东西
have you confirmed that notepad really exists at that assumed location on the server?

If its a 64-bit OS then that is not where Notepad resides.
I am unsure about the location of Notepad in something like WinServer2003/5/8


感谢您的回复。我做了检查,记事本确实驻留在那个位置。这可能是记事本无法打开的唯一原因。?
Thanks for the reply. I did check and notepad does reside at that location. Could that be the only reason notepad does not open.?


哪个操作系统是服务器和本地机器,记事本在失败时会给出任何错误?如果它是较新的操作系统之一,我想知道它是否有任何问题从Windows目录运行。我在这里的一个例子就是我已经习惯了Windows XP,但是当我在工作中使用Windows 2008服务器时,我被整个提升的权限搞砸了。它让我疯狂如何运行具有管理员权限的程序,即使该帐户应该是管理员。我知道这是为了提高安全性,但它仍然令人讨厌:)


无论如何,你认为它可能是那样的吗?
Which OS is the server and the local machine, and does notepad give any errors when it fails? If it''s one of the newer operating systems, I''m wondering if it has any issues running from the windows directory. An example of what I mean here is that I''m used to windows XP, but when I work on windows 2008 servers at work I get messed up by the whole elevated privileges thing. It drives me nuts how I have to run programs with admin privileges, even if the account is supposedly an administrator. I know it''s for improved security, but it''s still annoying :)

Anyway, do you think it could be something like that?

这篇关于用C#/ Asp.net打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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