//你好,我试图让我的代码工作我的比较如果字符串更大或小于10,但它无法正常工作.即使该值小于10,它也会写入10或更多.
int result = string1.CompareTo("10");
if (result < 0)
{
Console.WriteLine("less than 10");
}
else if (result >= 0)
{
Console.WriteLine("10 or more");
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试学习如何根据用户选择的时间来安排图片.
这是带有问题的代码:
private void startjob()
{
string theDate = DateTimePicker1.Value.ToString();
DateTime dt = Convert.ToDateTime(date);
{
DateTime start = new DateTime(2009, 12, 9, 10, 0, 0); //How Do I make this to read the string that is converted from DateTimePicker instead of this?
DateTime end = new DateTime(2009, 12, 10, 12, 0, 0); //How Do I make this to read the string that is converted from DateTimePicker instead of this?
DateTime now = DateTime.Now;
if ((now > start) && (now < …Run Code Online (Sandbox Code Playgroud)