当前位置: 首页>>代码示例>>C#>>正文


C# Instance.GetUrl方法代码示例

本文整理汇总了C#中SIM.Instances.Instance.GetUrl方法的典型用法代码示例。如果您正苦于以下问题:C# Instance.GetUrl方法的具体用法?C# Instance.GetUrl怎么用?C# Instance.GetUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SIM.Instances.Instance的用法示例。


在下文中一共展示了Instance.GetUrl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Browse

 public static void Browse(Instance instance, string virtualPath, bool isFrontEnd, string browser, string[] parameters)
 {
     string url = instance.GetUrl();
       if (!string.IsNullOrEmpty(url))
       {
     url += '/' + virtualPath.TrimStart('/');
     CoreApp.OpenInBrowser(url, isFrontEnd, browser, parameters);
       }
 }
开发者ID:Sitecore,项目名称:Sitecore-Instance-Manager,代码行数:9,代码来源:InstanceHelperEx.cs

示例2: StartInstance

        public static void StartInstance(Instance instance, int? timeout = null, string reason = null)
        {
            Assert.ArgumentNotNull(instance, "instance");

              string url = instance.GetUrl(@"/sitecore/service/keepalive.aspx?ts=" + DateTime.Now.Ticks + "&reason=" + (reason ?? "default"));
              Assert.IsNotNullOrEmpty(url, "url");
              try
              {
            WebRequestHelper.DownloadString(url, timeout);
              }
              catch (WebException ex)
              {
            string text = "There is an issue with requesting '" + url + "'. ";
            var webResponse = ex.Response;
            if (webResponse != null)
            {
              using (var s = webResponse.GetResponseStream())
              {
            if (s != null)
            {
              using (StreamReader streamReader = new StreamReader(s))
              {
                text = streamReader.ReadToEnd();
              }
            }
            else
            {
              text += "No error response stream provided.";
            }
              }
            }
            else
            {
              text += "No error response provided.";
            }

            string text2 = string.Empty;
            try
            {
              text2 = text.Substring(text.IndexOf("<title>") + "<title>".Length);
              text2 = text2.Substring(0, text2.IndexOf("</title>"));
            }
            catch (Exception)
            {
              text2 = text.Substring(0, Math.Min(text.Length, 200));
            }

            throw new WebException("{0} \r\nStatus: {1} \r\n{2}".FormatWith(ex.Message, ex.Status.ToString(), text2), ex);
              }
        }
开发者ID:Brad-Christie,项目名称:Sitecore-Instance-Manager,代码行数:50,代码来源:InstanceHelper.cs

示例3: GetUrl

 public static string GetUrl(Instance instance, string pageName, string value = null, string key = null)
 {
   return instance.GetUrl(AgentPath + '/' + pageName) + (!string.IsNullOrEmpty(value) ? "?" + (key ?? "fileName") + "=" + HttpUtility.UrlEncode(value) : string.Empty);
 }
开发者ID:lennartfranke,项目名称:Sitecore-Instance-Manager,代码行数:4,代码来源:AgentHelper.cs

示例4: GetWebServiceUrl

 private static string GetWebServiceUrl(Instance instance)
 {
     return instance.GetUrl("/sitecore/shell/webservice/service.asmx");
 }
开发者ID:steviemcg,项目名称:Sitecore-Instance-Manager,代码行数:4,代码来源:ConfigurationActions.cs

示例5: ProcessInstanceClickInternal

 protected override bool ProcessInstanceClickInternal(Instance instance)
 {
     var runParams = this.GetRunPageParams();
       WindowHelper.OpenInBrowser(instance.GetUrl(runParams.Item2), !runParams.Item1);
       return true;
 }
开发者ID:Zvirja,项目名称:TrayPluginProductivityKit,代码行数:6,代码来源:RunPage.cs


注:本文中的SIM.Instances.Instance.GetUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。