我复制了代码以从 http://www.vbforums.com/showthread.php?t=616519 映射网络驱动器映射驱动器和 http://cjwdev.wordpress.com/2010/05/30/delete-network-drive/删除驱动器。我想知道这段代码中的“R”c 意味着什么:
RemoveNetworkDrive("R"c, True)
来自第一个链接,然后我想知道如何在变量中模拟此表示法,以便我可以检查第一个可用驱动器并将网络驱动器映射到该字母。我会在谷歌上搜索它,但由于我不知道“R”c 是什么意思,所以很难。
最佳答案
"R"c
是 "R"
的 Char
版本。当您想要指定字符而不是字符串时,可以使用它。
MSDN 有一些详细信息 here :
You can also create an array of strings from a single string by using the
String.Split
Method. The following example demonstrates the reverse of the previous example: it takes a shopping list and turns it into an array of shopping items. The separator in this case is an instance of theChar
data type; thus it is appended with the literal type characterc
.
Dim shoppingList As String = "Milk,Eggs,Bread"
Dim shoppingItem(2) As String
shoppingItem = shoppingList.Split(","c)
关于vb.net - 使用此函数映射网络驱动器时 "R"c 是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7528978/