From df0116e2d80530f884f96ed65fa57dbec5296686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9A=93=E6=9C=88?= <353374337@qq.com> Date: Fri, 19 Oct 2018 01:35:43 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=BA=E5=B8=A6=E6=8A=8AC#=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=B8=8A=E5=90=A7=20233333?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CodeShowWeb/Index.aspx | 21 ++++++++++++++---- CodeShowWeb/Index.aspx.cs | 40 ++++++++++++++++++++++++++++------ CoderEngine/CSharpCodeWrite.cs | 2 +- 3 files changed, 51 insertions(+), 12 deletions(-) diff --git a/CodeShowWeb/Index.aspx b/CodeShowWeb/Index.aspx index f1e4148..4d7d7bc 100644 --- a/CodeShowWeb/Index.aspx +++ b/CodeShowWeb/Index.aspx @@ -3,7 +3,7 @@
-
+
+ <%=GetCode() %>
+
+
+
-
+
<%=GetCode() %>
diff --git a/CodeShowWeb/Index.aspx.cs b/CodeShowWeb/Index.aspx.cs
index 01c80ba..d83fc43 100644
--- a/CodeShowWeb/Index.aspx.cs
+++ b/CodeShowWeb/Index.aspx.cs
@@ -17,25 +17,36 @@ namespace CodeShowWeb
public string GetCode()
{
- string CodeLang = GetLang();
+ string CodeLang = GetLangParam();
+
+ string CodeStr = "";
if (CodeLang == "Java")
{
- return new JavaCodeWrite().ModelToJavaCode("CoderEngine", "A");
+ CodeStr = new JavaCodeWrite().ModelToJavaCode("CoderEngine", "A");
}
else if (CodeLang == "Swift")
{
- return new SwiftCodeWrite().ModelToSwiftCode("CoderEngine", "A");
+ CodeStr = new SwiftCodeWrite().ModelToSwiftCode("CoderEngine", "A");
}
else if (CodeLang == "JavaScript")
{
- return new AjaxCodeWrite().ModelToAjaxCode("CoderEngine", "A");
+ CodeStr = new AjaxCodeWrite().ModelToAjaxCode("CoderEngine", "A");
+ }
+
+ else if (CodeLang == "CSharp")
+ {
+ CodeStr = new CSharpCodeWrite().ModelToCSCode("CoderEngine", "A");
}
- return "代码语言尚未支持";
+ //避免类似 List