早教吧作业答案频道 -->其他-->
C#的小问题usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Drawing.Color;namespaceConsoleApplication1{classProgram{publicstaticreadonlyColorBackColor;staticProgram(){DateTimenow=DateTime.Now;if(n
题目详情
C#的小问题using System; using System.Collections.Generic; using System.Text; using System.Drawing.Color; namespace ConsoleApplication1 { class Program { public static readonly Color BackColor; static Program() { DateTime now = DateTime.Now; if (now.DayOfWeek = DayOfWeek.Saturday || now.DayOfWeek = DayOfWeek.Sunday) BackColor = Color.Green; else BackColor = Color.Red; } private Program() { } } class Text { public static void Main() { Console.WriteLine(Program.BackColor.ToString()); } } } 错误 1 命名空间“System”中不存在类型或命名空间名称“Drawing”(是缺少程序集引用吗?) C:\Users\user\AppData\Local\Temporary Projects\ConsoleApplication1\Program.cs 4 14 ConsoleApplication1 错误 2 找不到类型或命名空间名称“Color”(是否缺少 using 指令或程序集引用?) C:\Users\user\AppData\Local\Temporary Projects\ConsoleApplication1\Program.cs 9 32 ConsoleApplication1
▼优质解答
答案和解析
using System; using System.Collections.Generic; using System.Text; using System.Drawing;//here namespace ConsoleApplication1 { class Program { public static readonly Color BackColor; static Program() { DateTime now = DateTime.Now; if (now.DayOfWeek == DayOfWeek.Saturday || now.DayOfWeek == DayOfWeek.Sunday)//here BackColor = Color.Green; else BackColor = Color.Red; } private Program() { } } class Text { public static void Main() { Console.WriteLine(Program.BackColor.ToString()); } } } 修改了2个地方,
看了C#的小问题usingSyst...的网友还看了以下:
下列反应均为吸热反应,其中一定不能自发进行的是()A.(NH4)2CO3(s)=NH4HCO3(s 2020-04-11 …
已知下列热化学方程式:Fe2O3(s)+3CO(g)2Fe(s)+3CO2(g);△H="-24. 2020-05-13 …
已知下列热化学方程式:Na+(g)+Cl-(g)=NaCl(s)ΔHNa(s)+Cl2(g)=Na 2020-06-12 …
提问,关于二氧化硫转化为三氧化硫的问题二氧化硫转化为三氧化硫用五氧化二钒作催化剂,即SO2+V2O 2020-06-22 …
再再续化学题在120C°时分别进行以下四个反应:1.2H2s(s)+O2(g)===2H2O(g) 2020-07-09 …
已知:C(s)+O2(g)=CO2(g)ΔH=-393.5kJ/mol2CO(g)+O2(g)=2 2020-07-18 …
S(单斜)和S(正交)是硫的两种同素异形体。已知:①S(单斜,s)+O2(g)=SO2(g)ΔH1 2020-07-19 …
请写出下列反应平衡常数K的表达式CH四(g)+2O二(g)=CO二(g)+2H二O(g)AL二O三 2020-07-29 …
下列各组热化学方程式中,化学反应的△H前者大于后者的是①C(s)+O2(g)====CO2(g);△ 2020-12-14 …
下列反应中,在高温下不能自发进行的是A.CO(g)=C(s)+0.5O2(g)B.2CuO(s)=C 2020-12-24 …