For Each x In GetType(System.Environment.SpecialFolder).GetEnumValues Debug.Print("{0} {1}", [Enum].GetName(GetType(System.Environment.SpecialFolder), x), System.Environment.GetFolderPath(x)) Next 打印结结果 Desktop C:\Users\Administrator\Desktop Pro
运行Windows Task Manager,查看Users标签,可以看到所有登录电脑的用户,现在Insus.NET想命名用VB.NET的WinForm程序去获取当前的用户名. 获取程序简单,可以参考之: 源代码: Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, ByRef nSize As Integer) As Inte
Private Sub random(ByVal num As Integer, ByVal min As Integer, ByVal max As Integer) Dim i As Integer = 1 Dim number As Integer Dim numbers As String = "" While i <= num number = CInt(Rnd() * (max - min + 1) + 1) While InStr(numbers, "'&
C#调用方法.函数获取属性大致流程如下: System.Type oType = System.Type.GetTypeFromProgID("SomeClass"); object o = System.Activator.CreateInstance(oType); oType.InvokeMember("SomeMethod", System.Reflection.BindingFlags.InvokeMethod, null, o, new object[]