我想检查是否已安装JDK。
我不想检查是否C:\Program Files\Java\jdk1.8.0_25
存在,因为用户可能安装了旧版本。我想检查是否在C:\Program Files\Java
包含string的目录内jdk
。
我可以那样做吗?
直接来自MSDN。
Try
Dim dirPath As String = "your directory where JDK might be present"
Dim dirs As List(Of String) = New List(Of String)(Directory.EnumerateDirectories(dirPath))
For Each folder In dirs
' Logic to check existence of word "JDK" from end
' If found break
Next
Catch UAEx As UnauthorizedAccessException
' Error Handling
Catch PathEx As PathTooLongException
' Error Handling
End Try
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句