服务端功能
接收上传图片,并保存到本地
var files = Request.Form.Files;
var file=files[0];
var fileSavePath="c:\upload\filename.img";
using (FileStream fs = System.IO.File.Create(fileSavePath))
{
file.CopyTo(fs);//保存原图
fs.Flush();
}
.net 类库
字符串列表是否包含目标字符串,忽略大小写
List<string> list = new List<string> { "Hello", "World", "C#" };
string target = "hello";
bool contains = list.Any(s => String.Equals(s, target, StringComparison.OrdinalIgnoreCase));
Console.WriteLine(contains); // 输出:True
标签:fileSavePath,片段,fs,代码,contains,file,var,快捷方式 From: https://www.cnblogs.com/idasheng/p/17986669更新于:2024-01-25