FSharp 控制台查询
open System;;
let login () =
Console.WriteLine ("正在登录服务器 . . .")
let setEnv () =
Console.WriteLine ("正在设置环境 . . .")
let runQuery () =
Console.WriteLine ("正在运行查询 . . .")
Console.WriteLine ("查询结束")
Console.WriteLine ("按 Enter 键继续")
Console.ReadLine()
let main () =
login ()
setEnv ()
let mutable keepLooping = true
while keepLooping do
Console.WriteLine ("按 R 运行查询,按 Q 结束查询")
let k = Console.ReadKey()
k |> ignore
match k.Key with
| ConsoleKey.R -> runQuery () |> ignore
| ConsoleKey.Q -> keepLooping <- false
| _ -> keepLooping <- true