using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CoderEngine; namespace CodeShowWeb { public partial class CodeShow : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } public string GetCode() { string CodeLang = GetLang(); if (CodeLang == "Java") { return new JavaCodeWrite().ModelToJavaCode("CoderEngine", "A"); } else if (CodeLang == "swift") { return new SwiftCodeWrite().ModelToSwiftCode("CoderEngine", "A"); } return "代码语言尚未支持"; } public string GetLang() { var lang = Request.QueryString["Lang"]; if (lang != null && lang != "") { return lang; } else return "Java"; } public string GetCodeStyle() { string CodeLang = GetLang(); if (CodeLang == "Java") { return "androidstudio.css"; } else if (CodeLang == "swift") { return "xcode.css"; } return "代码语言尚未支持"; } } }