本文整理匯總了C#中System.UriBuilder.Replace方法的典型用法代碼示例。如果您正苦於以下問題:C# UriBuilder.Replace方法的具體用法?C# UriBuilder.Replace怎麽用?C# UriBuilder.Replace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.UriBuilder
的用法示例。
在下文中一共展示了UriBuilder.Replace方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ProcessHelpPageRequest
public override void ProcessHelpPageRequest(HttpContext context) {
using (var stream = GetType().Assembly.GetManifestResourceStream("Microsoft.PythonTools.WebRole.WebSocketProxy.html"))
using (var reader = new StreamReader(stream)) {
string html = reader.ReadToEnd();
var wsUri = new UriBuilder(context.Request.Url) { Scheme = "wss", Port = -1, UserName = "secret" }.ToString();
wsUri = wsUri.Replace("[email protected]", "<span class='secret'>secret</span>@");
context.Response.Write(html.Replace("{{WS_URI}}", wsUri));
context.Response.End();
}
}
示例2: GetPrefixes
internal IEnumerable<string> GetPrefixes()
{
foreach (var baseUri in this.baseUriList)
{
var prefix = new UriBuilder(baseUri).ToString();
if (this.configuration.RewriteLocalhost && !baseUri.Host.Contains("."))
{
prefix = prefix.Replace("localhost", "+");
}
yield return prefix;
}
}
示例3: GetPrefixes
private IEnumerable<string> GetPrefixes()
{
foreach (var baseUri in _baseUriList)
{
var prefix = new UriBuilder(baseUri).ToString();
bool rewriteLocalhost = true;
if (rewriteLocalhost && !baseUri.Host.Contains("."))
{
prefix = prefix.Replace("localhost", "+");
}
yield return prefix;
}
}