早教吧作业答案频道 -->其他-->
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={s|s=t^2-1,t属于R},B={(t,s)|s=t^2-1,t属于R},则A并B 2020-03-30 …
高一一道证明题已知S是两个整数平方和的集合,即S={x|x=m^2+n^2},m、n∈Z求证:1、 2020-05-13 …
PI的 初始值为什么是pi=1#includemain(){int s;float n,t,pi; 2020-05-16 …
根据句意填空.Ann and Joan are( 1 ) .They look( 2 ) each 2020-05-16 …
在298K时,NaCl在水中的溶解度为26g100g水.如将1molNaCl溶解在1L水中,此溶解 2020-05-17 …
集合R与S的差表示为()。A.{t|t∈R∨t∈S}B.{t|t∈R∧t∈S}C.{t|t∈R∧tS 2020-05-24 …
● 对给定文法G=(VN,VT, P,S),VT={a,Λ,(,)},VN={S,T},S是开始符号 2020-05-26 …
已知函数y=f(x)在t=0处可导,且具有性质f(t+s)=(f(t)+f(s))/(1-f(t) 2020-06-08 …
s=vt,v=s/t,t=s/v哪个是基本公式?其实我是想问.比如v=s/t那按数学来推不是vt= 2020-06-12 …
What’sthematter?中的t’s和the怎么发音我知道the要咬舌的可是一咬舌发音就发的 2020-06-23 …