计算WEB服务器(ASP.NET)上某个文件夹中的图像 [英] Count images in some folder on WEB server (ASP.NET)

查看:51
本文介绍了计算WEB服务器(ASP.NET)上某个文件夹中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要计算并检查在Web服务器的文件夹中放置了多少图像.示例-图像从 user_id 获取名称,例如,我有 user_id 27 ,而我的图像是:

I need to count and check how much of some images is placed in folder od web server. Example- images get names from user_id, and on example I have user_id 27, and my images are:

27_1.jpg, 27_2.jpg, 27_3.jpg, ...

如何检查并写入数据库?

How to check and write to database this thing?

谢谢

推荐答案

一旦知道了路径,就可以使用IO.Directory.GetFiles()方法.

Once you know your path you can use IO.Directory.GetFiles() method.

IO.Directory.GetFiles("\translated\path","27_*.jpg").Count()

将为您提供所需的内容.

will give you what you're looking for.

这篇关于计算WEB服务器(ASP.NET)上某个文件夹中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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