本帖最后由 happy886rr 于 2017-7-25 11:00 编辑
JS混编- 1>1/* :
- @cscript -nologo -e:jscript "%~f0" %*&@exit /b %errorlevel%*/
-
- try{
- WScript.echo(encodeURIComponent(WScript.Arguments(0)));
- }catch(e){
- WScript.echo('Usage: juri [url]');
- }
复制代码 C#混编- /*************************************************************************
- @ECHO OFF&CLS&TITLE MINI CSHARP COMPILER BY HAPPY
- for /f "delims=" %%a in ('dir /a-d /b /s "%systemroot%\Microsoft.NET\Framework\csc.exe"') do (
- >nul "%%~a" /out:juri.exe "%~f0" && juri.exe
- pause&exit/b
- )
- )
- set/p=You needs Microsoft.NET!&exit/b
- **************************************************************************/
-
- /*************************************************************************
- C# URL ENCODE TOOL, COPYRIGHT@2017~2019, VERSION 1.0
- JURI.EXE
- **************************************************************************/
- using System;
-
- namespace Juri
- {
- class JuriCore
- {
- static void Main(string[] argv)
- {
- if(argv.Length == 1)
- {
- Console.WriteLine(System.Web.HttpUtility.UrlEncode(argv[0]));
- }
- else if(argv.Length == 2)
- {
- string enURL="";
- if(String.Equals(argv[0], "--UTF8", StringComparison.CurrentCultureIgnoreCase))
- {
- enURL=System.Web.HttpUtility.UrlEncode(argv[1], System.Text.Encoding.UTF8);
- }
- else if(String.Equals(argv[0], "--GB2312", StringComparison.CurrentCultureIgnoreCase))
- {
- enURL=System.Web.HttpUtility.UrlEncode(argv[1], System.Text.Encoding.GetEncoding("GB2312"));
- }
- else{
- Console.WriteLine("Unkonwn switch '{0}'", argv[0]);
- }
- Console.WriteLine(enURL);
- }
- else
- {
- Console.WriteLine("{0}"
- , "Juri v1.0 - C# URL encode tool - Copyright (C) 2017-2019\n"
- + "Usage: juri ([--UTF8|--GB2312]) [URL]\n"
- + "\n"
- + "General options:\n"
- + " --UTF8 Encode to UTF8\n"
- + " --GB2312 Encode to GB2312\n"
- + " --HELP Show help information\n"
- );
- }
- }
- }
- }
复制代码
|