📄 viewcode.aspx.cs
字号:
using System;
using System.IO;
using ptw.FileManager.Web.Processor;
public partial class Manage_ViewCode : System.Web.UI.Page
{
protected string highLighterJs;
protected void Page_Load(object sender, EventArgs e)
{
string filePath = Request.QueryString["objfile"];
if (File.Exists(filePath))
{
string fileExt;
string fileContent;
string getEncode;
string highLighterType = "";
switch (Path.GetExtension(filePath).ToLower())
{
case ".c":
case ".cpp":
highLighterType = "cpp";
highLighterJs = "shBrushCpp.js";
break;
case ".cs":
highLighterType = "csharp";
highLighterJs = "shBrushCSharp.js";
break;
case ".css":
highLighterType = "css";
highLighterJs = "shBrushCss.js";
break;
case ".java":
case ".jsp":
highLighterType = "java";
highLighterJs = "shBrushJava.js";
break;
case ".js":
highLighterType = "javascript";
highLighterJs = "shBrushJScript.js";
break;
case ".php":
highLighterType = "php";
highLighterJs = "shBrushPhp.js";
break;
case ".sql":
highLighterType = "sql";
highLighterJs = "shBrushSql.js";
break;
case ".vb":
highLighterType = "vb";
highLighterJs = "shBrushVb.js";
break;
case ".xml":
case ".htm":
case ".html":
case ".aspx":
highLighterType = "xml";
highLighterJs = "shBrushXml.js";
break;
}
new FileManagerProcessor().ReadTextFile(filePath, out fileContent, out getEncode);
txtHighLighter.Text = fileContent;
txtHighLighter.CssClass = highLighterType;
}
else
{
Response.Clear();
Response.StatusCode = 404;
Response.StatusDescription = "Not Found";
Response.Status = "404 Not Found";
Response.Write("404 Not Found");
Response.End();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -