有什么方法可以将int[][]数组转换/ 转换为object[][]数组吗?
int[][] = FillArray();
object[][] = iArray;
Run Code Online (Sandbox Code Playgroud) 我有一个winform应用程序,我需要使标签背面闪烁.我试图使用for循环和Thread.Sleep,但不起作用.感谢您的帮助和建议:
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < 10; i++)
{
System.Threading.Thread.Sleep(1000); // Set fast to slow.
if (label1.BackColor == Color.Red)
label1.BackColor = Color.Transparent;
else
label1.BackColor = Color.Red;
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个xml文件,当前正在获取按标签名称的元素。我试图实现的是指定要使用的块,例如书店或商店。感谢您的帮助和建议。
XML:
<VariablesSpecs name="Data01">
<bookstore>
<book genre='novel' ISBN='10-861003-324'>
<title>The Handmaid's Tale</title>
<price>19.95</price>
</book>
</bookstore>
<shop>
<book genre='novel' ISBN='10-861003-324'>
<title>The Handmaid's Tale</title>
<price>19.95</price>
</book>
</shop>
</VariablesSpecs>
Run Code Online (Sandbox Code Playgroud)
码:
var doc = new XmlDocument();
doc.Load("data.xml");
var bookNodes = doc.GetElementsByTagName("book");
foreach (var bookNode in bookNodes)
{
// Collect data.
}
Run Code Online (Sandbox Code Playgroud) 我的任务是创建一种计算线性插值的方法,其中 Y 是日期时间值,X 是整数值。例如,查看以下值,如何找到 7、8 和 9 的值?
Date: Value:
05/01/2013 5
06/01/2013 7
10/01/2013 9
11/01/2013 1
15/01/2013 7
17/01/2013 2
02/02/2013 8
EDIT:
int interpMethod(DateTime x0, int y0, DateTime x1, int y1, int x)
{
return y0 * (x - x1) / (x0 - x1) + y1 * (x - x0) / (x1 - x0);
}
Run Code Online (Sandbox Code Playgroud) 我有一个lambda表达式,我想找回匹配的值.这是一个例子:
if (Keywords.Any(s => sourceString.Contains(" " + s.Trim())))
return s;
Run Code Online (Sandbox Code Playgroud) c# ×5
arrays ×1
casting ×1
lambda ×1
linq-to-xml ×1
task ×1
timer ×1
windows ×1
xml ×1
xmldocument ×1