发布网友 发布时间:2022-04-21 19:24
共3个回答
热心网友 时间:2023-09-28 19:03
获取里面MyEvent这个事件的反馈值Imports System
Imports System.Reflection
Imports System.Security
Imports Microsoft.VisualBasic
' Compile this sample using the following command line:
' vbc type_getevent.vb /r:"System.Windows.Forms.dll" /r:"System.dll"
Class MyEventExample
Public Shared Sub Main()
Try
Dim myType As Type = GetType(System.Windows.Forms.Button)
Dim myEvent As EventInfo = myType.GetEvent("Click")
If Not (myEvent Is Nothing) Then
Console.WriteLine(ControlChars.Cr + "Looking for the Click event in the Button class.")
Console.WriteLine(ControlChars.Cr + myEvent.ToString())
Else
Console.WriteLine("The Click event is not available with the Button class.")
End If
Catch e As SecurityException
Console.WriteLine("An exception occurred.")
Console.WriteLine("Message :" + e.Message)
Catch e As ArgumentNullException
Console.WriteLine("An exception occurred.")
Console.WriteLine("Message :" + e.Message)
Catch e As Exception
Console.WriteLine("The following exception was raised : {0}", e.Message)
End Try
End Sub 'Main
End Class 'MyEventExample
热心网友 时间:2023-09-28 19:03
好个骨瘦如柴版! 可要在此基础上要再转为时分秒可就胖了追问求增肥!
追答@echo off
call :ctime 6:25:40.41 6:25:44.73 t
goto :next
:ctime <begin_time> <end_time> <return>
rem 无论传入是否带毫秒将忽略它
rem 返回时间为24h以内尾数(即相差是整天数),为hh:mm:ss格式
setlocal
for /f "tokens=1-6 delims=:" %%a in ("%1:%2")do (
set/a "sh=100+%%d-%%a,sm=2%%e-1%%b,ss=2%%~nf-1%%~nc")
if %ss% lss 100 set/a ss+=60,sm-=1
if %sm% lss 100 set/a sm+=60,sh-=1
if %sh% lss 100 set/a sh+=24
endlocal&set %3=%sh:~-2%:%sm:~-2%:%ss:~-2%
goto :eof
:next
echo %t%
pause
热心网友 时间:2023-09-28 19:04
Call :etime 6:25:40.41 6:25:44.73 return
Echo %return%
Pause
:etime <begin_time> <end_time> <return>
rem 所测试任务的执行时间不超过1天 // 骨瘦如柴版
setlocal&set be=%~1:%~2&set cc=(%%d-%%a)*360000+(1%%e-1%%b)*6000+1%%f-1%%c&set dy=-80000
for /f "delims=: tokens=1-6" %%a in ("%be:.=%")do endlocal&set/a %3=%cc%,%3+=%dy%*("%3>>31")&exit/b
用的是14楼的代码.