简体   繁体   中英

Get windows build number in Haskell

How can I get windows build number in Haskell? I think I can use readProcess and ver , but maybe there are more clear methods.

Is there a native C function in WinAPI that returns Windows build number?

If yes, you can easily call it from Haskell using ForeignFunctionInterface extension.

The Win32 package seems to allow to access the build number, within the IO monad. Untested.

import System.Win32.Info.Version -- from Win32 package

main :: IO ()
main = do
   osVersionInfo <- getVersionEx
   print (dwBuildNumber osVersionInfo)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM