File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed
snippets/fsharp/System/PlatformID/Overview Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk" >
2+ <PropertyGroup >
3+ <OutputType >Exe</OutputType >
4+ <TargetFramework >net6.0</TargetFramework >
5+ </PropertyGroup >
6+
7+ <ItemGroup >
8+ <Compile Include =" pid.fs" />
9+ </ItemGroup >
10+ </Project >
Original file line number Diff line number Diff line change 1+ //<snippet1>
2+ // This example demonstrates the PlatformID enumeration.
3+ open System
4+
5+ let msg1 = " This is a Windows operating system."
6+ let msg2 = " This is a Unix operating system."
7+ let msg3 = " ERROR: This platform identifier is invalid."
8+
9+ // Assume this example is run on a Windows operating system.
10+ let os = Environment.OSVersion
11+ let pid = os.Platform
12+ match pid with
13+ | PlatformID.Win32NT
14+ | PlatformID.Win32S
15+ | PlatformID.Win32Windows
16+ | PlatformID.WinCE ->
17+ printfn $" {msg1}"
18+ | PlatformID.Unix ->
19+ printfn $" {msg2}"
20+ | _ ->
21+ printfn $" {msg3}"
22+ // This example produces the following results:
23+ // This is a Windows operating system.
24+ //</snippet1>
Original file line number Diff line number Diff line change 6666
6767 :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/platformID.class/CPP/pid.cpp" id="Snippet1":::
6868 :::code language="csharp" source="~/snippets/csharp/System/PlatformID/Overview/pid.cs" id="Snippet1":::
69+ :::code language="fsharp" source="~/snippets/fsharp/System/PlatformID/Overview/pid.fs" id="Snippet1":::
6970 :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/platformID.class/VB/pid.vb" id="Snippet1":::
7071
7172 ]]> </format >
You can’t perform that action at this time.
0 commit comments