06 2021 档案
摘要:<InkCanvas Name="inkCanvas"></InkCanvas> <Button Name="btnRecognize" Content="RecognizeAsync" HorizontalAlignment="Left" Height="104" Margin="0,0,0,0"
阅读全文
摘要:这个函数在处理循环时可以每生成一个数据就返回一个数据让主函数进行处理: static void Main(string[] args) { foreach (var item in GetNumbers()) Console.WriteLine("Main process. item = " + i
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.InteropServic
阅读全文
摘要:模拟10个线程,每个线程模拟100次取钱: 其实就是相当于1000个人来同时取钱。当然实际情况是取钱的人分布在不同的地区的取款机取钱。同一个取款机只能一个人操作。 关键是要保证取钱的余额要准确,不能在多人同时操作的时候计算失误,于是要在计算余额的时候锁住。lock关键作用在于此。 static vo
阅读全文
摘要:public interface IService { void DoSomething(ref string a); void DoSomething2(out string a); } [TestMethod] public void TestRefPara() { var service =
阅读全文
摘要:测试: public class UnitTest1 { [TestMethod] public void TestMethod1() { Mock<TestClass> moc = new Mock<TestClass>(); moc.Setup(x => x.GetItem(It.IsAny<i
阅读全文
摘要:public static Size ScreenSize { get { //screen resolution var height = DisplayInformation.GetForCurrentView().ScreenHeightInRawPixels; var width = Dis
阅读全文