PDA

View Full Version : یک راهنمائی در مورد یک تابع



omid-vbAuto
سه شنبه 05 مهر 1390, 21:48 عصر
با سلام

دوستان اینها رو ایمپورت کنید:

Imports System.IO
Imports System.Globalization
Imports System.Security.AccessControl

و کد های زیر رو هم بنویسید:


Public curDir As String

Public Function GetDriveType(ByVal d As DriveInfo, ByVal network As Boolean) As String
Dim typeName As String

Select Case d.DriveType
Case DriveType.Removable
typeName = "فلاپی"
Case DriveType.CDRom
typeName = "دیسک خوان"
Case DriveType.Fixed
typeName = "دیسک جانبی"
Case DriveType.Network
If Not network Then
typeName = "دیسک شبکه"
Else
typeName = "ناشناخته"
End If
Case Else
typeName = "ناشناخته"
End Select

Return typeName

End Function
Public Function GetDriveIndex(ByVal d As DriveInfo) As Integer
Select Case d.DriveType
Case DriveType.Removable
Return 2
Case DriveType.CDRom
Return 0
Case DriveType.Fixed
Return 3
Case DriveType.Network
Return 7
End Select

Return 5

End Function
Public Function GetNameAndType(ByVal d As DriveInfo) As String
Return String.Format(CultureInfo.CurrentCulture, "{0} ({1})", GetDriveType(d, False), d.Name.Substring(0, 2))
End Function



حالا سوال من در استفاده از تابع GetNameAndType هستش:

1- CultureInfo.CurrentCulture ؟
2-"{0} ({1})" ؟
3-GetDriveType(d, False) ؟
4- d.Name.Substring(0, 2) ؟

این ها یعنی چی؟؟؟ لطفا یکی راهنمائی کنه.