我已经做了很多搜索似乎是一个简单的LINQ问题,但我无法弄清楚如何从具有指定最小值(或最大值)的集合中抓取一个对象而不采用这样的排序:
dim customers= GetCustomers()
dim youngest = (From c in customers
                 Order By c.age Ascending).ToList.First
此(未经测试的代码)结构可正常工作,但必须对整个客户数组进行排序并将其放入列表中,以便仅提取第一个值.这不是获得最低限度的最佳方式!
请注意,在这种情况下我想要整个c记录,而不是像这样可以完成的客户的最小年龄(典型示例):
dim customers= GetCustomers()
dim youngest = (From c in customers
                 Select c.age).Min
甚至
dim customers= GetCustomers()
dim youngest = (From c in customers
                 Select c).Min(Function(x) x.age)
我不能为我的生活弄清楚如何获得整个对象(甚至索引)而不诉诸于排序......
我在构建过程中使用命令行中的7zip创建一个zip文件.使用这样的命令:
7z.exe a -pPassword"..\sot.zip".
此命令正常工作,我能够按预期看到加密文件.现在,当我添加加密头的功能时
7z.exe a -mhe = on -pPassword"..\sot.zip".7z.exe a -mhe + -pPassword"..\sot.zip".
7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
Scanning
Creating archive sot.zip
System error:
The parameter is incorrect.我得到"参数不正确".错误无论我把它们放在命令行上的哪个位置.
有没有办法从命令行执行标头加密.