Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows 11 Version 21H2 - June 2023 Samples Update
* BluetoothLE: Protect against bad device thumbnails #905 * BarcodeScanner: Add software trigger support to scenario 1 #681 * New: NetworkConnectivity * Archived: BarcodeScanner VB and C++/CX
- Loading branch information
1 parent
ad9a0c4
commit 118d53b
Showing
67 changed files
with
2,404 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
page_type: sample | ||
languages: | ||
- csharp | ||
- cpp | ||
- cppwinrt | ||
products: | ||
- windows | ||
- windows-uwp | ||
urlFragment: NetworkingConnectivity | ||
extendedZipContent: | ||
- path: SharedContent | ||
target: SharedContent | ||
- path: LICENSE | ||
target: LICENSE | ||
description: "Shows how to query network connectivity and respond to network connectivity changes." | ||
--- | ||
|
||
# NetworkingConnectivity sample | ||
|
||
Demonstrates how to use the NetworkInformation and related classes | ||
to determine the network connectivity status, | ||
and shows how to use this information to determine | ||
when to attempt to connect to the Internet. | ||
|
||
Apps can use the NetworkInformation and related Windows Runtime classes | ||
to check the network connectivity status before attempting to connect to the Internet. | ||
These class simplify the complex task of determining connectivity for various network configurations. | ||
These checks are not strictly required because higher-level APIs (such as HttpClient) | ||
report insufficient network connectivity through failures/results at the point of connection. | ||
|
||
This sample also demonstrates how to register for network connectivity change events. | ||
Apps can subscribe to the events instead of building their | ||
own logic to track network connectivity changes. | ||
|
||
> **Note:** This sample is part of a large collection of UWP feature samples. | ||
> You can download this sample as a standalone ZIP file | ||
> [from docs.microsoft.com](https://docs.microsoft.com/samples/microsoft/windows-universal-samples/networkingconnectivity/), | ||
> or you can download the entire collection as a single | ||
> [ZIP file](https://github.com/Microsoft/Windows-universal-samples/archive/main.zip), but be | ||
> sure to unzip everything to access shared dependencies. For more info on working with the ZIP file, | ||
> the samples collection, and GitHub, see [Get the UWP samples from GitHub](https://aka.ms/ovu2uq). | ||
> For more samples, see the [Samples portal](https://aka.ms/winsamples) on the Windows Dev Center. | ||
|
||
### Declaring the internetClient capability | ||
|
||
This sample requires that internetClient capability be set in the *Package.appxmanifest* file to allow the app to access the Internet connection at runtime. | ||
The capability can be set in the app manifest using Microsoft Visual Studio. | ||
|
||
## System requirements | ||
|
||
* Windows 10 | ||
|
||
## Build the sample | ||
|
||
1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build. | ||
2. Start Microsoft Visual Studio and select **File** \> **Open** \> **Project/Solution**. | ||
3. Starting in the folder where you unzipped the samples, go to the Samples subfolder, then the subfolder for this specific sample, then the subfolder for your preferred language (C++, C#, or JavaScript). Double-click the Visual Studio Solution (.sln) file. | ||
4. Press Ctrl+Shift+B or select **Build** \> **Build Solution**. | ||
|
||
## Run the sample | ||
|
||
The next steps depend on whether you just want to deploy the sample or you want to both deploy and run it. | ||
|
||
### Deploying the sample | ||
|
||
- Select Build > Deploy Solution. | ||
|
||
### Debugging and running the sample | ||
|
||
- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or select Debug > Start Without Debugging. |
43 changes: 43 additions & 0 deletions
43
Samples/NetworkConnectivity/cppwinrt/NetworkConnectivity.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.5.33516.290 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetworkConnectivity", "NetworkConnectivity.vcxproj", "{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|ARM64 = Debug|ARM64 | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|ARM64 = Release|ARM64 | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Debug|ARM64.ActiveCfg = Debug|ARM64 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Debug|ARM64.Build.0 = Debug|ARM64 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Debug|ARM64.Deploy.0 = Debug|ARM64 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Debug|x64.ActiveCfg = Debug|x64 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Debug|x64.Build.0 = Debug|x64 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Debug|x64.Deploy.0 = Debug|x64 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Debug|x86.Build.0 = Debug|Win32 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Debug|x86.Deploy.0 = Debug|Win32 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Release|ARM64.ActiveCfg = Release|ARM64 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Release|ARM64.Build.0 = Release|ARM64 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Release|ARM64.Deploy.0 = Release|ARM64 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Release|x64.ActiveCfg = Release|x64 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Release|x64.Build.0 = Release|x64 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Release|x64.Deploy.0 = Release|x64 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Release|x86.ActiveCfg = Release|Win32 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Release|x86.Build.0 = Release|Win32 | ||
{21C18BA0-582C-4264-B0DD-7F2867D8E3D6}.Release|x86.Deploy.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {77D722D2-6DBF-402D-9B3B-6473BA169D27} | ||
EndGlobalSection | ||
EndGlobal |
Oops, something went wrong.