string[]arr1=new[]{"1","2","3","4","5"};string[]arr2=new[]{"1","3","5"};//找出相同元素(即交集)varsameArr=arr1.Intersect(arr2).ToArray();//找出不同的元素(即交集的补集)vardiffArr=arr1.Where(c=>!arr2.Contains(c)).ToArray();
1.从string[]转到List<string>string[]strArr={"hello","world","string"};List<string>listStr=newList<string>(strArr);2.从List<String>转到String[]List<string>listStr=newList<string>();listStr.Add("hello");listStr.Add("world");string[]...
单线程的winfom程序中,设置一个控件的值是很easy的事情,直接this.TextBox1.value="HelloWorld!";就搞定了,但是如果在一个新线程中这么做,比如:privatevoidbtnSet_Click(objectsender,EventArgse){Threadt=newThread(newParameterizedThreadStart(SetTextBoxVal...