예제 #1
0
        private static string GenerateUrl(JsTestOption option, JsTest.JsTestCommand.JsCommand command, string Folder, string File, string function = null)
        {
            string url = option.RequestPrefix + "/exe";

            Dictionary <string, string> para = new Dictionary <string, string>();
            string cmdname = command.ToString();

            if (!string.IsNullOrEmpty(cmdname))
            {
                para.Add("command", cmdname);
            }

            if (!string.IsNullOrEmpty(Folder))
            {
                para.Add("folder", Folder);
            }

            if (!string.IsNullOrEmpty(File))
            {
                para.Add("file", File);
            }

            if (!string.IsNullOrEmpty(function))
            {
                para.Add("function", function);
            }

            return(Lib.Helper.UrlHelper.AppendQueryString(url, para));
        }
예제 #2
0
        private static string GeneratejsFile(JsTestOption option, string FileName, JsTest.JsTestCommand.JsCommand command = JsTestCommand.JsCommand.view, string function = null)
        {
            string prefix = option.RequestPrefix;

            if (!prefix.EndsWith("/") && !prefix.EndsWith("\\"))
            {
                prefix = prefix + "/";
            }

            if (FileName.StartsWith("/") || FileName.StartsWith("\\"))
            {
                FileName = FileName.Substring(1);
            }

            string name = Lib.Helper.UrlHelper.Combine(prefix, FileName);

            name += "?command=" + command.ToString();
            if (!string.IsNullOrEmpty(function))
            {
                name += "&function=" + function;
            }

            return(name);
        }