本文整理汇总了C#中System.Uri.str方法的典型用法代码示例。如果您正苦于以下问题:C# Uri.str方法的具体用法?C# Uri.str怎么用?C# Uri.str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Uri
的用法示例。
在下文中一共展示了Uri.str方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: config
public void config(string toolName, string version, string instalDir, string installFile, Uri installUri)
{
ToolName = toolName;
Version = version;
Install_Dir = instalDir;
Install_Uri = installUri;
Install_File = installFile;
VersionWebDownload = Install_Uri.str();
}
示例2: add_Mapping_Redirect
public static VirtualArticleAction add_Mapping_Redirect(this TM_Xml_Database tmXmlDatabase, Guid id, Uri redirectUri)
{
var virtualAction = new VirtualArticleAction
{
Id = id,
Action = "Redirect",
Redirect_Uri = redirectUri.str()
};
tmXmlDatabase.getVirtualArticles().add(id, virtualAction);
tmXmlDatabase.saveVirtualArticles();
return virtualAction;
}
示例3: download
public string download(Uri uri)
{
"Downloading from Uri: {0}".info(uri);
if (uri.isNull())
return null;
VersionWebDownload = uri.str();
//var localFilePath = PublicDI.config.O2TempDir.pathCombine(CurrentVersionZipFile);
//"downloading file {0} from {1} to {2}".info(CurrentVersionZipFile, CurrentVersionWebDownload,localFilePath);
"downloading file {0}".info(VersionWebDownload);
//if (new Web().httpFileExists(VersionWebDownload))
//{
// var downloadedFile = new Web().downloadBinaryFile(VersionWebDownload);
var downloadedFile = VersionWebDownload.download();
if (downloadedFile.fileExists())
{
var targetFile = tempLocationOf_Install_File();//localDownloadsDir.pathCombine(Install_File);
"Copying file: {0}".info(targetFile);
Files.Copy(downloadedFile, targetFile);
"Deleting file: {0}".info(targetFile);
Files.deleteFile(downloadedFile);
if (targetFile.fileExists())
return targetFile;
}
//}
return null;
}
示例4: show
public ascx_HtmlTagViewer show(Uri uri)
{
if (PageToOpen.notNull())
PageToOpen.set_Text(uri.str());
return show(uri.getHtml());
}
示例5: download
public string download(Uri uri)
{
var targetFile = tempLocationOf_Install_File();//localDownloadsDir.pathCombine(Install_File);
if (targetFile.fileExists())
{
"found previously downloaded copy: {0}".info(targetFile);
return targetFile;
}
"Downloading from Uri: {0}".info(uri);
if (uri.isNull())
return null;
VersionWebDownload = uri.str();
var downloadedFile = VersionWebDownload.download();
if (downloadedFile.fileExists())
{
for(int i =0 ; i< 5; i++) // try to get the file 5 times since sometimes the file is still not available (due to AV)
{
this.sleep(1000);
"Copying file: {0}".info(targetFile);
if (Files.copy(downloadedFile, targetFile).valid())
{
"Deleting file: {0}".info(downloadedFile);
Files.deleteFile(downloadedFile);
}
if (targetFile.fileExists())
return targetFile;
}
};
return null;
}
示例6: open
public static WatiN_IE open(this WatiN_IE watinIe, Uri uri)
{
return (watinIe.notNull() && uri.notNull())
? watinIe.open(uri.str())
: watinIe;
}
示例7: wait_For_Uri
public static WatiN_IE wait_For_Uri(this WatiN_IE watinIe, Uri expectedUri, int maxWait = 1000)
{
return (watinIe.notNull() && expectedUri.notNull())
? watinIe.wait_For_Url(expectedUri.str(),maxWait)
: watinIe;
}
示例8: assert_Uri_Is
public static WatiN_IE assert_Uri_Is(this WatiN_IE watinIe, Uri expectedUri, string message = Extra_NUnit_Messages.ASSERT_URL_IS)
{
return (watinIe.notNull() && expectedUri.notNull())
? watinIe.assert_Url_Is(expectedUri.str(),message)
: watinIe;
}