为什么下面的代码不起作用?
open System
open System.Runtime.InteropServices
open System.ComponentModel
[<DllImport("kernel32")>]
extern int AddDllDirectory(string NewDirectory)
[<EntryPoint>]
let main argv =
let result = AddDllDirectory("c:\\")
if result = 0 then
printfn "%A" <| Win32Exception(Marshal.GetLastWin32Error())
// Prints: "System.ComponentModel.Win32Exception (0x80004005): The parameter is incorrect"
System.Console.ReadLine() |> ignore
0 // return an integer exit code