如何检查文档是否存在? [英] How Do I Check Whether Document Exist Or Not ?
本文介绍了如何检查文档是否存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想查看文件是否存在。这是文档上载的源代码。
I would like to check the document exist or not. This is the source code for Document Upload.
推荐答案
您可以检查用户是否选择了 FileUpload.HasFile [ ^ ]
You can check if the user has selected a file with FileUpload.HasFile[^]
if (fuDocument.HasFile)
{
...
但你无法专门检查客户端计算机上是否存在文件。
虽然服务器上存在文件但很简单:
but you can't check specifically to see if a file exists on the client computer.
It's simple to check if the file exists on the server already though:
if (File.Exists(path))
{
...
这篇关于如何检查文档是否存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文