??C#?????dos???????????????
???????????? ???????[ 2013/11/18 13:46:49 ] ????????
?????????????
????subts????????????????????????????????????????????????????????net use????????????????C#?????????????????????????????·???????????net use??????
??????????C#?????????
<span style="white-space:pre"> </span>[DllImport("mpr.dll"?? CharSet = CharSet.Unicode?? SetLastError = true)]
public static extern int WNetGetConnection(
[MarshalAs(UnmanagedType.LPTStr)] string localName??
[MarshalAs(UnmanagedType.LPTStr)] StringBuilder remoteName??
ref int length);
/// <summary>
/// Given a path?? returns the UNC path or the original. (No exceptions
/// are raised by this function directly). For example?? "P:2008-02-29"
/// might return: "\networkserverSharesPhotos2008-02-09"
/// </summary>
/// <param name="originalPath">The path to convert to a UNC Path</param>
/// <returns>A UNC path. If a network drive letter is specified?? the
/// drive letter is converted to a UNC or network path. If the
/// originalPath cannot be converted?? it is returned unchanged.</returns>
public string GetPathForMappedDriveFile(string originalPath)
{
StringBuilder sb = new StringBuilder(512);
int size = sb.Capacity;
// look for the {LETTER}: combination ...
if (originalPath.Length > 2 && originalPath[1] == ':')
{
// don't use char.IsLetter here - as that can be misleading
// the only valid drive letters are a-z && A-Z.
char c = originalPath[0];
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
{
int error = WNetGetConnection(originalPath.Substring(0?? 2)??
sb?? ref size);
if (error == 0)
{
DirectoryInfo dir = new DirectoryInfo(originalPath);
string path = Path.GetFullPath(originalPath)
.Substring(Path.GetPathRoot(originalPath).Length);
return Path.Combine(sb.ToString().TrimEnd()?? path);
}
}
}
return originalPath;
}
|
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????