diff --git a/includes/forms-auth-warning.md b/includes/forms-auth-warning.md
new file mode 100644
index 00000000000..e364edc46cb
--- /dev/null
+++ b/includes/forms-auth-warning.md
@@ -0,0 +1,2 @@
+> [!WARNING]
+> Storing user credentials in the `credentials` section is **insecure**. Instead, use [Azure Key Vault](/azure/key-vault/general/overview).
diff --git a/includes/ropc-warning.md b/includes/ropc-warning.md
new file mode 100644
index 00000000000..35a98fd91b9
--- /dev/null
+++ b/includes/ropc-warning.md
@@ -0,0 +1,2 @@
+> [!WARNING]
+> Microsoft does not recommend providing your user name and password directly, because it's an insecure pattern. Where possible, use more secure authentication flows, such as [Managed Identities for Azure resources](/sql/connect/ado-net/sql/azure-active-directory-authentication#using-managed-identity-authentication), or [Windows authentication](/sql/relational-databases/security/choose-an-authentication-mode#connecting-through-windows-authentication) for SQL Server.
diff --git a/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader Example/CS/Project.csproj b/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader Example/CS/Project.csproj
index 8b9dd0d90fa..9de5f49321c 100644
--- a/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader Example/CS/Project.csproj
+++ b/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader Example/CS/Project.csproj
@@ -2,11 +2,11 @@
Exe
- net6.0
+ net8.0
-
+
-
+
-
+
diff --git a/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader2/CS/Project.csproj b/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader2/CS/Project.csproj
index 5dd5749509a..9de5f49321c 100644
--- a/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader2/CS/Project.csproj
+++ b/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader2/CS/Project.csproj
@@ -1,12 +1,12 @@
-
+
Exe
- net6.0
+ net8.0
-
+
-
+
-
+
diff --git a/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction Example/CS/Project.csproj b/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction Example/CS/Project.csproj
index 5de403ea829..9de5f49321c 100644
--- a/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction Example/CS/Project.csproj
+++ b/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction Example/CS/Project.csproj
@@ -2,11 +2,11 @@
Exe
- net6.0
+ net8.0
-
+
-
\ No newline at end of file
+
diff --git a/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction2 Example/CS/Project.csproj b/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction2 Example/CS/Project.csproj
index 5de403ea829..9de5f49321c 100644
--- a/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction2 Example/CS/Project.csproj
+++ b/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction2 Example/CS/Project.csproj
@@ -2,11 +2,11 @@
Exe
- net6.0
+ net8.0
-
+
-
\ No newline at end of file
+
diff --git a/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction3 Example/CS/Project.csproj b/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction3 Example/CS/Project.csproj
index 5de403ea829..9de5f49321c 100644
--- a/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction3 Example/CS/Project.csproj
+++ b/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction3 Example/CS/Project.csproj
@@ -2,11 +2,11 @@
Exe
- net6.0
+ net8.0
-
+
-
\ No newline at end of file
+
diff --git a/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.Read Example/CS/SqlDataReader.Read.csproj b/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.Read Example/CS/SqlDataReader.Read.csproj
index fb16c894d2e..9de5f49321c 100644
--- a/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.Read Example/CS/SqlDataReader.Read.csproj
+++ b/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.Read Example/CS/SqlDataReader.Read.csproj
@@ -2,12 +2,11 @@
Exe
- net6.0
- enable
+ net8.0
-
+
diff --git a/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/CS/Project.csproj b/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/CS/Project.csproj
new file mode 100644
index 00000000000..9de5f49321c
--- /dev/null
+++ b/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/CS/Project.csproj
@@ -0,0 +1,12 @@
+
+
+
+ Exe
+ net8.0
+
+
+
+
+
+
+
diff --git a/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/CS/source.cs b/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/CS/source.cs
index 50ae5218dac..01d17ad7cd8 100644
--- a/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/CS/source.cs
+++ b/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/CS/source.cs
@@ -10,38 +10,29 @@ static void Main()
try
{
string connectString =
- "Data Source=(local);User ID=ab;Password= a1Pass@@11;" +
+ "Data Source=(local);User ID=ab;Password=myPassw0rd;" +
"Initial Catalog=AdventureWorks";
- SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(connectString);
- Console.WriteLine("Original: " + builder.ConnectionString);
+ SqlConnectionStringBuilder builder = new(connectString);
+ Console.WriteLine($"Original: {builder.ConnectionString}");
- // Use the Remove method
- // in order to reset the user ID and password back to their
- // default (empty string) values.
+ // Remove the User ID and Password.
builder.Remove("User ID");
builder.Remove("Password");
- // Turn on integrated security:
+ // Enable integrated security.
builder.IntegratedSecurity = true;
- Console.WriteLine("Modified: " + builder.ConnectionString);
-
- using (SqlConnection
- connection = new SqlConnection(builder.ConnectionString))
- {
- connection.Open();
- // Now use the open connection.
- Console.WriteLine("Database = " + connection.Database);
- }
+ Console.WriteLine($"Modified: {builder.ConnectionString}");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
-
- Console.WriteLine("Press any key to finish.");
- Console.ReadLine();
}
}
+/* This code example produces the following output:
+ * Original: Data Source=(local);Initial Catalog=AdventureWorks;User ID=ab;Password=myPassw0rd
+ * Modified: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True
+ */
//
diff --git a/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/CS/Project.csproj b/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/CS/Project.csproj
new file mode 100644
index 00000000000..8a04f9a7a22
--- /dev/null
+++ b/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/CS/Project.csproj
@@ -0,0 +1,13 @@
+
+
+
+ Exe
+ net4.8
+ 11
+
+
+
+
+
+
+
diff --git a/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/CS/source.cs b/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/CS/source.cs
index 157e8c853f0..16898449859 100644
--- a/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/CS/source.cs
+++ b/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/CS/source.cs
@@ -1,56 +1,37 @@
-
-
-using System;
-//
-using System.Data;
+using System;
using System.Data.SqlClient;
class Program
{
static void Main()
{
+ //
// Create a new SqlConnectionStringBuilder and
// initialize it with a few name/value pairs.
- SqlConnectionStringBuilder builder =
- new SqlConnectionStringBuilder(GetConnectionString());
+ SqlConnectionStringBuilder builder = new(
+ "Server=(local);Integrated Security=true;" +
+ "Initial Catalog=AdventureWorks"
+ );
// The input connection string used the
// Server key, but the new connection string uses
// the well-known Data Source key instead.
- Console.WriteLine(builder.ConnectionString);
-
- // Pass the SqlConnectionStringBuilder an existing
- // connection string, and you can retrieve and
- // modify any of the elements.
- builder.ConnectionString = "server=(local);user id=ab;" +
- "password= a!Pass113;initial catalog=AdventureWorks";
+ Console.WriteLine($"Original connection string: '{builder.ConnectionString}'");
// Now that the connection string has been parsed,
// you can work with individual items.
- Console.WriteLine(builder.Password);
- builder.Password = "new@1Password";
+ Console.WriteLine($"Initial catalog: '{builder.InitialCatalog}'");
+ builder.InitialCatalog = "Northwind";
builder.AsynchronousProcessing = true;
// You can refer to connection keys using strings,
// as well. When you use this technique (the default
// Item property in Visual Basic, or the indexer in C#),
- // you can specify any synonym for the connection string key
- // name.
+ // you can specify any synonym for the connection string key name.
builder["Server"] = ".";
builder["Connect Timeout"] = 1000;
builder["Trusted_Connection"] = true;
- Console.WriteLine(builder.ConnectionString);
-
- Console.WriteLine("Press Enter to finish.");
- Console.ReadLine();
- }
-
- private static string GetConnectionString()
- {
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
- return "Server=(local);Integrated Security=SSPI;" +
- "Initial Catalog=AdventureWorks";
+ Console.WriteLine($"Modified connection string: '{builder.ConnectionString}'");
+ //
}
}
-//
diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/CS/Project.csproj b/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/CS/Project.csproj
new file mode 100644
index 00000000000..51ddd88b23d
--- /dev/null
+++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/CS/Project.csproj
@@ -0,0 +1,13 @@
+
+
+
+ Exe
+ net4.8
+
+
+
+
+
+
+
+
diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/CS/authenticationsection.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/CS/authenticationsection.cs
index ba6c070f5a5..3f872563955 100644
--- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/CS/authenticationsection.cs
+++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/CS/authenticationsection.cs
@@ -1,61 +1,52 @@
using System;
-using System.Configuration;
-using System.Web.Configuration;
using System.Web;
+using System.Web.Configuration;
namespace Samples.AspNet.Configuration
{
-
class UsingAuthenticationSection
{
- public static void Main()
- {
-
+ public static void Main()
+ {
//
// Get the Web application configuration.
System.Configuration.Configuration configuration =
- System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(
+ WebConfigurationManager.OpenWebConfiguration(
"/aspnetTest");
- // Get the section.
+ // Get the authentication section.
AuthenticationSection authenticationSection =
(AuthenticationSection)configuration.GetSection(
"system.web/authentication");
-
//
//
- AuthenticationSection newauthenticationSection =
+ AuthenticationSection newauthenticationSection =
new AuthenticationSection();
-
//
//
// Get the current Passport property.
- PassportAuthentication currentPassport =
+ PassportAuthentication currentPassport =
authenticationSection.Passport;
// Get the Passport redirect URL.
- string passRedirectUrl =
- currentPassport.RedirectUrl;
-
+ string passRedirectUrl = currentPassport.RedirectUrl;
//
//
// Get the current Mode property.
- AuthenticationMode currentMode =
+ AuthenticationMode currentMode =
authenticationSection.Mode;
// Set the Mode property to Windows.
- authenticationSection.Mode =
+ authenticationSection.Mode =
AuthenticationMode.Windows;
-
//
//
// Get the current Forms property.
-
- FormsAuthenticationConfiguration currentForms =
+ FormsAuthenticationConfiguration currentForms =
authenticationSection.Forms;
// Get the Forms attributes.
@@ -71,8 +62,7 @@ public static void Main()
FormsProtectionEnum protection = currentForms.Protection;
string defaultUrl = currentForms.DefaultUrl;
string domain = currentForms.Domain;
-
//
}
- }
+ }
}
diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/CS/Project.csproj b/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/CS/Project.csproj
new file mode 100644
index 00000000000..51ddd88b23d
--- /dev/null
+++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/CS/Project.csproj
@@ -0,0 +1,13 @@
+
+
+
+ Exe
+ net4.8
+
+
+
+
+
+
+
+
diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/CS/formsauthenticationconfiguration.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/CS/formsauthenticationconfiguration.cs
index 541c8e4d5fd..bdca16bab35 100644
--- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/CS/formsauthenticationconfiguration.cs
+++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/CS/formsauthenticationconfiguration.cs
@@ -1,99 +1,85 @@
-using System;
-using System.Text;
-using System.Configuration;
+using System.Web;
using System.Web.Configuration;
-using System.Web;
namespace Samples.Aspnet.Configuration
{
-
class UsingFormsAuthentication
{
-
public static void Main()
{
-
//
// Get the Web application configuration.
- System.Configuration.Configuration configuration =
+ System.Configuration.Configuration configuration =
WebConfigurationManager.OpenWebConfiguration("/aspnetTest");
// Get the external Authentication section.
- AuthenticationSection authenticationSection =
+ AuthenticationSection authenticationSection =
(AuthenticationSection)configuration.GetSection(
"system.web/authentication");
// Get the external Forms section .
FormsAuthenticationConfiguration formsAuthentication =
authenticationSection.Forms;
-
//
//
// Create a new FormsAuthentication object.
FormsAuthenticationConfiguration newformsAuthentication =
new FormsAuthenticationConfiguration();
-
//
//
// Get the current LoginUrl.
string currentLoginUrl = formsAuthentication.LoginUrl;
- // Set the LoginUrl.
+ // Set the LoginUrl.
formsAuthentication.LoginUrl = "newLoginUrl";
-
//
//
// Get current DefaultUrl.
- string currentDefaultUrl =
+ string currentDefaultUrl =
formsAuthentication.DefaultUrl;
// Set current DefaultUrl.
formsAuthentication.DefaultUrl = "newDefaultUrl";
-
//
//
// Get current Cookieless.
- System.Web.HttpCookieMode currentCookieless =
+ System.Web.HttpCookieMode currentCookieless =
formsAuthentication.Cookieless;
-
+
// Set current Cookieless.
- formsAuthentication.Cookieless =
+ formsAuthentication.Cookieless =
HttpCookieMode.AutoDetect;
-
//
//
// Get the current Domain.
- string currentDomain =
+ string currentDomain =
formsAuthentication.Domain;
// Set the current Domain
formsAuthentication.Domain = "newDomain";
-
//
//
// Get the current SlidingExpiration.
- bool currentSlidingExpiration =
+ bool currentSlidingExpiration =
formsAuthentication.SlidingExpiration;
// Set the SlidingExpiration.
formsAuthentication.SlidingExpiration = false;
-
//
//
// Get the current EnableCrossAppRedirects.
- bool currentEnableCrossAppRedirects =
+ bool currentEnableCrossAppRedirects =
formsAuthentication.EnableCrossAppRedirects;
// Set the EnableCrossAppRedirects.
formsAuthentication.EnableCrossAppRedirects = false;
-
//
//
@@ -101,39 +87,35 @@ public static void Main()
string currentPath = formsAuthentication.Path;
// Set the Path property.
formsAuthentication.Path = "newPath";
-
//
//
// Get the current Timeout.
- System.TimeSpan currentTimeout =
+ System.TimeSpan currentTimeout =
formsAuthentication.Timeout;
-
+
// Set the Timeout.
- formsAuthentication.Timeout =
+ formsAuthentication.Timeout =
System.TimeSpan.FromMinutes(10);
-
//
//
// Get the current Protection.
- FormsProtectionEnum currentProtection =
+ FormsProtectionEnum currentProtection =
formsAuthentication.Protection;
// Set the Protection property.
- formsAuthentication.Protection =
+ formsAuthentication.Protection =
FormsProtectionEnum.All;
-
//
//
// Get the current RequireSSL.
- bool currentRequireSSL =
+ bool currentRequireSSL =
formsAuthentication.RequireSSL;
// Set the RequireSSL property value.
formsAuthentication.RequireSSL = true;
-
//
//
@@ -141,25 +123,7 @@ public static void Main()
string currentName = formsAuthentication.Name;
// Set the Name property value.
formsAuthentication.Name = "newName";
-
//
-
- //
- // Get the current Credentials.
- FormsAuthenticationCredentials currentCredentials =
- formsAuthentication.Credentials;
-
- StringBuilder credentials = new StringBuilder();
- // Get all the credentials.
- for (System.Int32 i = 0; i < currentCredentials.Users.Count; i++)
- {
- credentials.Append("Name: " +
- currentCredentials.Users[i].Name +
- " Password: " +
- currentCredentials.Users[i].Password);
- credentials.Append(Environment.NewLine);
- }
- //
}
}
}
diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs
deleted file mode 100644
index dc92c50e6b5..00000000000
--- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs
+++ /dev/null
@@ -1,199 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.IO;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Configuration;
-using System.Web.Configuration;
-
-namespace Samples.AspNet
-{
-
- class UsingFormsAuthenticationCredentials
- {
-
- public static void Main()
- {
-
- //
-
- // Get the Web application configuration.
- System.Configuration.Configuration configuration =
- WebConfigurationManager.OpenWebConfiguration("/aspnetTest");
-
- // Get the authentication section.
- AuthenticationSection authenticationSection =
- (AuthenticationSection)configuration.GetSection(
- "system.web/authentication");
-
- // Get the forms credentials collection .
- FormsAuthenticationCredentials formsAuthenticationCredentials =
- authenticationSection.Forms.Credentials;
-
- //
-
- //
- // Create a new FormsAuthenticationCredentials object.
- FormsAuthenticationCredentials newformsAuthenticationCredentials =
- new FormsAuthenticationCredentials();
-
- //
-
- //
- // Get the current PasswordFormat property value.
- FormsAuthPasswordFormat currentPasswordFormat =
- formsAuthenticationCredentials.PasswordFormat;
-
- // Set the PasswordFormat property value.
- // This example uses the SHA1 algorithm.
- // Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
- formsAuthenticationCredentials.PasswordFormat =
- FormsAuthPasswordFormat.SHA1;
-
- //
-
- //
-
- // Create a new FormsAuthenticationUserCollection object.
- FormsAuthenticationUserCollection newformsAuthenticationUser =
- new FormsAuthenticationUserCollection();
-
- //
-
- //
- // Display all credentials collection elements.
- StringBuilder credentials = new StringBuilder();
- for (System.Int32 i = 0;
- i < formsAuthenticationCredentials.Users.Count;
- i++)
- {
- credentials.Append("User: " +
- formsAuthenticationCredentials.Users[i].Name);
- credentials.Append("Password: " +
- formsAuthenticationCredentials.Users[i].Password);
- credentials.Append(Environment.NewLine);
- }
- //
-
- //
- // Using method Add.
-
- // Define the SHA1 encrypted password.
- // This example uses the SHA1 algorithm.
- // Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
- string password =
- "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8";
- // Define the user name.
- string userName = "newUser";
-
- // Create the new user.
- FormsAuthenticationUser currentUser =
- new FormsAuthenticationUser(userName, password);
-
- // Execute the Add method.
- formsAuthenticationCredentials.Users.Add(currentUser);
-
- // Update if not locked
- if (!authenticationSection.SectionInformation.IsLocked)
- {
- configuration.Save();
- }
-
- //
-
- //
- // Using method Clear.
- formsAuthenticationCredentials.Users.Clear();
- // Update if not locked
- if (!authenticationSection.SectionInformation.IsLocked)
- {
- configuration.Save();
- }
- //
-
- //
- // Using method Remove.
- // Execute the Remove method.
- formsAuthenticationCredentials.Users.Remove("userName");
-
- // Update if not locked
- if (!authenticationSection.SectionInformation.IsLocked)
- {
- configuration.Save();
- }
- //
-
- //
- // Using method RemoveAt.
- formsAuthenticationCredentials.Users.RemoveAt(0);
-
- if (!authenticationSection.SectionInformation.IsLocked)
- {
- configuration.Save();
- }
- //
-
- //
- // Using method Set.
-
- // Define the SHA1 encrypted password.
- string newPassword =
- "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8";
- // Define the user name.
- string currentUserName = "userName";
-
- // Create the new user.
- FormsAuthenticationUser theUser =
- new FormsAuthenticationUser(currentUserName, newPassword);
-
- formsAuthenticationCredentials.Users.Set(theUser);
-
- if (!authenticationSection.SectionInformation.IsLocked)
- {
- configuration.Save();
- }
- //
-
- //
- // Get the user with the specified name.
- FormsAuthenticationUser storedUser =
- formsAuthenticationCredentials.Users.Get("userName");
-
- //
-
- //
- // Get the user at the specified index.
- FormsAuthenticationUser storedUser2 =
- formsAuthenticationCredentials.Users.Get(0);
-
- //
-
- //
- // Get the key at the specified index.
- string thisKey = formsAuthenticationCredentials.Users.GetKey(0).ToString();
-
- //
-
- //
- // Get the user element at the specified index.
- FormsAuthenticationUser storedUser3 =
- formsAuthenticationCredentials.Users[0];
-
- //
-
- //
- // Get the user element with the specified name.
- FormsAuthenticationUser storedUser4 =
- formsAuthenticationCredentials.Users["userName"];
-
- //
-
- //
- // Get the collection keys.
- object [] keys =
- formsAuthenticationCredentials.Users.AllKeys;
- //
- }
- }
-}
diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/CS/formsauthenticationuser.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/CS/formsauthenticationuser.cs
deleted file mode 100644
index e4913b235d3..00000000000
--- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/CS/formsauthenticationuser.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-using System;
-using System.Configuration;
-using System.Web.Configuration;
-using System.Web.Security;
-
-namespace Samples.Aspnet.SystemWebConfiguration
-{
-
-// Accesses the
-// System.Web.Configuration.FormsAuthenticationUser members
-// selected by the user.
- class UsingFormsAuthenticationUser
- {
-
- public static void Main()
- {
-
- //
-
- // Get the Web application configuration.
- System.Configuration.Configuration configuration =
- WebConfigurationManager.OpenWebConfiguration(
- "/aspnet");
- // Get the section.
- AuthenticationSection authenticationSection =
- (AuthenticationSection)configuration.GetSection(
- "system.web/authentication");
- // Get the users collection.
- FormsAuthenticationUserCollection formsAuthenticationUsers =
- authenticationSection.Forms.Credentials.Users;
-
- //
-
- //
-
- //
-
- //
-
- // Define the user name.
- string name = "userName";
- // Define the encrypted password.
- string password =
- "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8";
-
- // Create a new FormsAuthenticationUser object.
- FormsAuthenticationUser newformsAuthenticationUser =
- new FormsAuthenticationUser(name, password);
-
- //
-
- //
-
- // Using the Password property.
-
- // Get current password.
- string currentPassword =
- formsAuthenticationUsers[0].Password;
-
- // Set a SHA1 encrypted password.
- // This example uses the SHA1 algorithm.
- // Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
- formsAuthenticationUsers[0].Password =
- "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8";
-
- //
-
- //
-
- // Using the Name property.
-
- // Get current name.
- string currentName =
- formsAuthenticationUsers[0].Name;
-
- // Set a new name.
- formsAuthenticationUsers[0].Name = "userName";
-
- //
- }
- }
-}
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader Example/VB/Project.vbproj b/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader Example/VB/Project.vbproj
index 97be8759373..9de5f49321c 100644
--- a/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader Example/VB/Project.vbproj
+++ b/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader Example/VB/Project.vbproj
@@ -2,11 +2,11 @@
Exe
- net6.0
+ net8.0
-
+
diff --git a/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader2/VB/Project.vbproj b/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader2/VB/Project.vbproj
index 97be8759373..9de5f49321c 100644
--- a/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader2/VB/Project.vbproj
+++ b/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteReader2/VB/Project.vbproj
@@ -2,11 +2,11 @@
Exe
- net6.0
+ net8.0
-
+
diff --git a/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlCommand.SqlCommand2 Example/VB/Project.vbproj b/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlCommand.SqlCommand2 Example/VB/Project.vbproj
index 97be8759373..9de5f49321c 100644
--- a/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlCommand.SqlCommand2 Example/VB/Project.vbproj
+++ b/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlCommand.SqlCommand2 Example/VB/Project.vbproj
@@ -2,11 +2,11 @@
Exe
- net6.0
+ net8.0
-
+
diff --git a/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction Example/VB/Project.vbproj b/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction Example/VB/Project.vbproj
index 5de403ea829..9de5f49321c 100644
--- a/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction Example/VB/Project.vbproj
+++ b/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction Example/VB/Project.vbproj
@@ -2,11 +2,11 @@
Exe
- net6.0
+ net8.0
-
+
-
\ No newline at end of file
+
diff --git a/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction2 Example/VB/Project.vbproj b/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction2 Example/VB/Project.vbproj
index 5de403ea829..9de5f49321c 100644
--- a/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction2 Example/VB/Project.vbproj
+++ b/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction2 Example/VB/Project.vbproj
@@ -2,11 +2,11 @@
Exe
- net6.0
+ net8.0
-
+
-
\ No newline at end of file
+
diff --git a/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction3 Example/VB/Project.vbproj b/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction3 Example/VB/Project.vbproj
index 5de403ea829..9de5f49321c 100644
--- a/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction3 Example/VB/Project.vbproj
+++ b/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlConnection.BeginTransaction3 Example/VB/Project.vbproj
@@ -2,11 +2,11 @@
Exe
- net6.0
+ net8.0
-
+
-
\ No newline at end of file
+
diff --git a/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/VB/Project.vbproj b/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/VB/Project.vbproj
new file mode 100644
index 00000000000..9de5f49321c
--- /dev/null
+++ b/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/VB/Project.vbproj
@@ -0,0 +1,12 @@
+
+
+
+ Exe
+ net8.0
+
+
+
+
+
+
+
diff --git a/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/VB/source.vb b/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/VB/source.vb
index 32f3d7d7c27..830efa45218 100644
--- a/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/VB/source.vb
+++ b/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/VB/source.vb
@@ -1,44 +1,35 @@
-Option Explicit
-Option Strict
-
-Imports System.Data
-'
+Option Explicit On
+Option Strict On
Imports System.Data.SqlClient
-
+
Module Module1
- Sub Main()
- Try
- Dim connectString As String = _
- "Data Source=(local);User ID=ab;Password=a1Pass@@11;" & _
- "Initial Catalog=AdventureWorks"
-
- Dim builder As New SqlConnectionStringBuilder(connectString)
- Console.WriteLine("Original: " & builder.ConnectionString)
-
- ' Use the Remove method
- ' in order to reset the user ID and password back to their
- ' default (empty string) values.
- builder.Remove("User ID")
- builder.Remove("Password")
-
- ' Turn on integrated security:
- builder.IntegratedSecurity = True
-
- Console.WriteLine("Modified: " & builder.ConnectionString)
-
- Using connection As New SqlConnection(builder.ConnectionString)
- connection.Open()
- ' Now use the open connection.
- Console.WriteLine("Database = " & connection.Database)
- End Using
-
- Catch ex As Exception
- Console.WriteLine(ex.Message)
- End Try
-
- Console.WriteLine("Press any key to finish.")
- Console.ReadLine()
- End Sub
+ Sub Main()
+ Try
+ '
+ Dim connectString As String =
+ "Data Source=(local);User ID=ab;Password=a1Pass@@11;" &
+ "Initial Catalog=AdventureWorks"
+
+ Dim builder As New SqlConnectionStringBuilder(connectString)
+ Console.WriteLine("Original: " & builder.ConnectionString)
+
+ ' Remove the user ID and password.
+ builder.Remove("User ID")
+ builder.Remove("Password")
+
+ ' Turn on integrated security:
+ builder.IntegratedSecurity = True
+
+ Console.WriteLine("Modified: " & builder.ConnectionString)
+
+ Catch ex As Exception
+ Console.WriteLine(ex.Message)
+ End Try
+
+ ' This code produces the following output:
+ ' Original: Data Source=(local);Initial Catalog=AdventureWorks;User ID=ab;Password=a1Pass@@11
+ ' Modified: Data Source = (local);Initial Catalog=AdventureWorks;Integrated Security=True
+ '
+ End Sub
End Module
-'
diff --git a/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/VB/Project.vbproj b/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/VB/Project.vbproj
new file mode 100644
index 00000000000..09e9769f543
--- /dev/null
+++ b/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/VB/Project.vbproj
@@ -0,0 +1,12 @@
+
+
+
+ Exe
+ net4.8
+
+
+
+
+
+
+
diff --git a/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/VB/source.vb b/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/VB/source.vb
index 63d31e881f5..09962eaa3b9 100644
--- a/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/VB/source.vb
+++ b/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/VB/source.vb
@@ -1,7 +1,6 @@
-Option Explicit
-Option Strict
+Option Explicit On
+Option Strict On
-
'
Imports System.Data.SqlClient
@@ -9,23 +8,20 @@ Module Module1
Sub Main()
' Create a new SqlConnectionStringBuilder and
' initialize it with a few name/value pairs:
- Dim builder As New SqlConnectionStringBuilder(GetConnectionString())
+ Dim builder As New SqlConnectionStringBuilder(
+ "Server=(local);Integrated Security=true;" &
+ "Initial Catalog=AdventureWorks"
+ )
' The input connection string used the
' Server key, but the new connection string uses
' the well-known Data Source key instead.
- Console.WriteLine(builder.ConnectionString)
+ Console.WriteLine("Original connection string: " + builder.ConnectionString)
- ' Pass the SqlConnectionStringBuilder an existing
- ' connection string, and you can retrieve and
- ' modify any of the elements.
- builder.ConnectionString = _
- "server=(local);user id=ab;" & _
- "password=a!Pass113;initial catalog=AdventureWorks"
' Now that the connection string has been parsed,
' you can work with individual items.
- Console.WriteLine(builder.Password)
- builder.Password = "new@1Password"
+ Console.WriteLine("Initial catalog: " + builder.InitialCatalog)
+ builder.InitialCatalog = "Northwind"
builder.AsynchronousProcessing = True
' You can refer to connection keys using strings,
@@ -40,18 +36,8 @@ Module Module1
' and setting the Item property adds the value to the
' dictionary, if necessary.
builder.Item("Trusted_Connection") = True
- Console.WriteLine(builder.ConnectionString)
-
- Console.WriteLine("Press Enter to finish.")
- Console.ReadLine()
+ Console.WriteLine("Modified connection string: " + builder.ConnectionString)
End Sub
-
- Private Function GetConnectionString() As String
- ' To avoid storing the connection string in your code,
- ' you can retrieve it from a configuration file.
- Return "Server=(local);Integrated Security=SSPI;" & _
- "Initial Catalog=AdventureWorks"
- End Function
End Module
'
diff --git a/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/VB/Project.vbproj b/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/VB/Project.vbproj
new file mode 100644
index 00000000000..5b025122ed5
--- /dev/null
+++ b/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/VB/Project.vbproj
@@ -0,0 +1,17 @@
+
+
+
+ Exe
+ net4.8
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/VB/formsauthenticationconfiguration.vb b/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/VB/formsauthenticationconfiguration.vb
index eaa95078c25..b202371ea0d 100644
--- a/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/VB/formsauthenticationconfiguration.vb
+++ b/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/VB/formsauthenticationconfiguration.vb
@@ -1,172 +1,131 @@
-Imports System.Text
-Imports System.Configuration
-Imports System.Web.Configuration
+Imports System.Configuration
Imports System.Web
+Imports System.Web.Configuration
+Class UsingFormsAuthentication
+ Public Shared Sub Main()
-
-
-Class UsingFormsAuthentication
-
-
- Public Shared Sub Main()
-
- '
- ' Get the Web application configuration.
- Dim configuration As System.Configuration.Configuration = _
- WebConfigurationManager.OpenWebConfiguration( _
+ '
+ ' Get the Web application configuration.
+ Dim configuration As System.Configuration.Configuration =
+ WebConfigurationManager.OpenWebConfiguration(
"/aspnetTest")
-
- ' Get the external Authentication section.
+
+ ' Get the external Authentication section.
Dim authenticationSection _
- As AuthenticationSection = _
- CType(configuration.GetSection( _
+ As AuthenticationSection =
+ CType(configuration.GetSection(
"system.web/authentication"), AuthenticationSection)
-
- ' Get the external Forms section .
+
+ ' Get the external Forms section .
Dim formsAuthentication _
- As FormsAuthenticationConfiguration = _
+ As FormsAuthenticationConfiguration =
authenticationSection.Forms
-
- '
-
- '
- ' Create a new FormsAuthentication object.
+ '
+
+ '
+ ' Create a new FormsAuthentication object.
Dim newformsAuthentication _
As New FormsAuthenticationConfiguration()
-
- '
-
-
- '
- ' Get the current LoginUrl.
- Dim currentLoginUrl As String = _
+ '
+
+ '
+ ' Get the current LoginUrl.
+ Dim currentLoginUrl As String =
formsAuthentication.LoginUrl
-
- ' Set the LoginUrl.
- formsAuthentication.LoginUrl = "newLoginUrl"
-
- '
-
- '
- ' Get current DefaultUrl.
- Dim currentDefaultUrl As String = _
+
+ ' Set the LoginUrl.
+ formsAuthentication.LoginUrl = "newLoginUrl"
+ '
+
+ '
+ ' Get current DefaultUrl.
+ Dim currentDefaultUrl As String =
formsAuthentication.DefaultUrl
-
- ' Set current DefaultUrl.
- formsAuthentication.DefaultUrl = "newDefaultUrl"
-
- '
-
- '
- ' Get current Cookieless.
+
+ ' Set current DefaultUrl.
+ formsAuthentication.DefaultUrl = "newDefaultUrl"
+ '
+
+ '
+ ' Get current Cookieless.
Dim currentCookieless _
- As System.Web.HttpCookieMode = _
+ As System.Web.HttpCookieMode =
formsAuthentication.Cookieless
-
- ' Set current Cookieless.
- formsAuthentication.Cookieless = HttpCookieMode.AutoDetect
-
- '
-
- '
- ' Get the current Domain.
- Dim currentDomain As String = formsAuthentication.Domain
-
- ' Set the current Domain
- formsAuthentication.Domain = "newDomain"
-
-
- '
-
- '
- ' Get the current SlidingExpiration.
- Dim currentSlidingExpiration As Boolean = _
+
+ ' Set current Cookieless.
+ formsAuthentication.Cookieless = HttpCookieMode.AutoDetect
+ '
+
+ '
+ ' Get the current Domain.
+ Dim currentDomain As String = formsAuthentication.Domain
+
+ ' Set the current Domain
+ formsAuthentication.Domain = "newDomain"
+ '
+
+ '
+ ' Get the current SlidingExpiration.
+ Dim currentSlidingExpiration As Boolean =
formsAuthentication.SlidingExpiration
-
- ' Set the SlidingExpiration.
- formsAuthentication.SlidingExpiration = False
-
-
- '
-
- '
- ' Get the current EnableCrossAppRedirects.
- Dim currentEnableCrossAppRedirects As Boolean = _
+
+ ' Set the SlidingExpiration.
+ formsAuthentication.SlidingExpiration = False
+ '
+
+ '
+ ' Get the current EnableCrossAppRedirects.
+ Dim currentEnableCrossAppRedirects As Boolean =
formsAuthentication.EnableCrossAppRedirects
-
- ' Set the EnableCrossAppRedirects.
- formsAuthentication.EnableCrossAppRedirects = False
-
-
- '
-
- '
- ' Get the current Path.
- Dim currentPath As String = formsAuthentication.Path
- ' Set the Path property.
- formsAuthentication.Path = "newPath"
-
- '
- '
- ' Get the current Timeout.
- Dim currentTimeout As System.TimeSpan = _
+
+ ' Set the EnableCrossAppRedirects.
+ formsAuthentication.EnableCrossAppRedirects = False
+ '
+
+ '
+ ' Get the current Path.
+ Dim currentPath As String = formsAuthentication.Path
+ ' Set the Path property.
+ formsAuthentication.Path = "newPath"
+ '
+
+ '
+ ' Get the current Timeout.
+ Dim currentTimeout As System.TimeSpan =
formsAuthentication.Timeout
-
- ' Set the Timeout.
- formsAuthentication.Timeout = _
+
+ ' Set the Timeout.
+ formsAuthentication.Timeout =
System.TimeSpan.FromMinutes(10)
-
- '
-
- '
- ' Get the current Protection.
- Dim currentProtection As FormsProtectionEnum = _
+ '
+
+ '
+ ' Get the current Protection.
+ Dim currentProtection As FormsProtectionEnum =
formsAuthentication.Protection
-
- ' Set the Protection property.
- formsAuthentication.Protection = FormsProtectionEnum.All
-
- '
-
- '
- ' Get the current RequireSSL.
- Dim currentRequireSSL As Boolean = _
+
+ ' Set the Protection property.
+ formsAuthentication.Protection = FormsProtectionEnum.All
+ '
+
+ '
+ ' Get the current RequireSSL.
+ Dim currentRequireSSL As Boolean =
formsAuthentication.RequireSSL
-
- ' Set the RequireSSL property value.
- formsAuthentication.RequireSSL = True
-
- '
-
- '
- ' Get the current Name property value.
- Dim currentName As String = _
+
+ ' Set the RequireSSL property value.
+ formsAuthentication.RequireSSL = True
+ '
+
+ '
+ ' Get the current Name property value.
+ Dim currentName As String =
formsAuthentication.Name
- ' Set the Name property value.
- formsAuthentication.Name = "newName"
-
-
- '
-
- '
- ' Get the current Credentials.
- Dim currentCredentials _
- As FormsAuthenticationCredentials = _
- formsAuthentication.Credentials
-
- Dim credentials As New StringBuilder()
- ' Get all the credentials.
- Dim i As System.Int32
- For i = 0 To currentCredentials.Users.Count - 1
- credentials.Append(("Name: " + _
- currentCredentials.Users(i).Name + _
- " Password: " + _
- currentCredentials.Users(i).Password))
- credentials.Append(Environment.NewLine)
- Next i
- '
+ ' Set the Name property value.
+ formsAuthentication.Name = "newName"
+ '
End Sub
End Class
diff --git a/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb b/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb
deleted file mode 100644
index bfe155b5ba0..00000000000
--- a/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb
+++ /dev/null
@@ -1,191 +0,0 @@
-
-Imports System.Collections
-Imports System.Collections.Specialized
-Imports System.IO
-Imports System.Text
-Imports System.Text.RegularExpressions
-Imports System.Configuration
-Imports System.Web.Configuration
-
-
-
-
-Class UsingFormsAuthenticationCredentials
-
-
- Public Shared Sub Main()
-
- '
- ' Get the Web application configuration.
- Dim configuration As System.Configuration.Configuration = _
- WebConfigurationManager.OpenWebConfiguration( _
- "/aspnetTest")
-
- ' Get the authentication section.
- Dim authenticationSection _
- As AuthenticationSection = _
- CType(configuration.GetSection( _
- "system.web/authentication"), AuthenticationSection)
-
- ' Get the forms credentials collection .
- Dim formsAuthenticationCredentials _
- As FormsAuthenticationCredentials = _
- authenticationSection.Forms.Credentials
-
- '
-
- '
- ' Create a new FormsAuthenticationCredentials object.
- Dim newformsAuthenticationCredentials _
- As New FormsAuthenticationCredentials()
-
- '
-
-
- '
- ' Get the current PasswordFormat property value.
- Dim currentPasswordFormat _
- As FormsAuthPasswordFormat = _
- formsAuthenticationCredentials.PasswordFormat
-
-
- ' Set the PasswordFormat property value.
- ' This example uses the SHA1 algorithm.
- ' Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
- formsAuthenticationCredentials.PasswordFormat = _
- FormsAuthPasswordFormat.SHA1
-
- '
- '
- ' Create a new FormsAuthenticationUserCollection object.
- Dim newformsAuthenticationUser _
- As New FormsAuthenticationUserCollection()
-
- '
- '
- ' Display all credentials collection elements.
- Dim credentials As New StringBuilder()
- Dim i As System.Int32
- For i = 0 To formsAuthenticationCredentials.Users.Count - 1
- credentials.Append(("User: " _
- + formsAuthenticationCredentials.Users(i).Name))
- credentials.Append(("Password: " _
- + formsAuthenticationCredentials.Users(i).Password))
- credentials.Append(Environment.NewLine)
- Next i
- '
-
- '
- ' Using method Add.
- ' Define the SHA1 encrypted password.
- ' This example uses the SHA1 algorithm.
- ' Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
- Dim password As String = _
- "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8"
- ' Define the user name.
- Dim userName As String = "newUser"
-
- ' Create the new user.
- Dim currentUser _
- As New FormsAuthenticationUser(userName, password)
-
- ' Execute the Add method.
- formsAuthenticationCredentials.Users.Add(currentUser)
-
- ' Update if not locked
- If Not authenticationSection.SectionInformation.IsLocked Then
- configuration.Save()
- End If
-
- '
-
- '
- ' Using method Clear.
- formsAuthenticationCredentials.Users.Clear()
- ' Update if not locked
- If Not authenticationSection.SectionInformation.IsLocked Then
- configuration.Save()
- End If
- '
-
- '
- ' Using method Remove.
- ' Execute the Remove method.
- formsAuthenticationCredentials.Users.Remove("userName")
-
- ' Update if not locked
- If Not authenticationSection.SectionInformation.IsLocked Then
- configuration.Save()
- End If
- '
- '
- ' Using method RemoveAt.
- formsAuthenticationCredentials.Users.RemoveAt(0)
-
- If Not authenticationSection.SectionInformation.IsLocked Then
- configuration.Save()
- End If
- '
-
- '
- ' Using method Set.
- ' Define the SHA1 encrypted password.
- Dim newPassword As String = _
- "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8"
- ' Define the user name.
- Dim currentUserName As String = "userName"
-
- ' Create the new user.
- Dim theUser _
- As New FormsAuthenticationUser(currentUserName, newPassword)
-
- formsAuthenticationCredentials.Users.Set(theUser)
-
- If Not authenticationSection.SectionInformation.IsLocked Then
- configuration.Save()
- End If
- '
- '
- ' Get the user with the specified name.
- Dim storedUser As FormsAuthenticationUser = _
- formsAuthenticationCredentials.Users.Get("userName")
-
- '
- '
- ' Get the user at the specified index.
- Dim storedUser2 As FormsAuthenticationUser = _
- formsAuthenticationCredentials.Users.Get(0)
-
- '
- '
- ' Get the key at the specified index.
- Dim thisKey As String = _
- formsAuthenticationCredentials.Users.GetKey(0)
-
- '
- '
- ' Get the user element at the specified index.
- Dim storedUser3 As FormsAuthenticationUser = _
- formsAuthenticationCredentials.Users(0)
-
- '
- '
- ' Get the user element with the specified name.
- Dim storedUser4 As FormsAuthenticationUser = _
- formsAuthenticationCredentials.Users("userName")
-
- '
- '
- ' Get the collection keys.
- Dim keys As String() = _
- formsAuthenticationCredentials.Users.AllKeys
- '
-
- End Sub
-
-End Class
-
-
-
-
-
diff --git a/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/VB/formsauthenticationuser.vb b/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/VB/formsauthenticationuser.vb
deleted file mode 100644
index 36daaf2dfb1..00000000000
--- a/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/VB/formsauthenticationuser.vb
+++ /dev/null
@@ -1,73 +0,0 @@
-
-Imports System.Configuration
-Imports System.Web.Configuration
-Imports System.Web.Security
-
-
-
-' Accesses the
-' System.Web.Configuration.FormsAuthenticationUser members
-' selected by the user.
-
-Class UsingFormsAuthenticationUser
-
-
- Public Shared Sub Main()
-
- '
- ' Get the Web application configuration.
- Dim configuration _
- As System.Configuration.Configuration = _
- WebConfigurationManager.OpenWebConfiguration( _
- "/aspnet")
- ' Get the section.
- Dim authenticationSection _
- As AuthenticationSection = _
- CType(configuration.GetSection( _
- "system.web/authentication"), AuthenticationSection)
- ' Get the users collection.
- Dim formsAuthenticationUsers _
- As FormsAuthenticationUserCollection = _
- authenticationSection.Forms.Credentials.Users
-
- '
-
- '
- ' Define the user name.
- Dim name As String = "userName"
- ' Define the encrypted password.
- Dim password As String = _
- "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8"
-
- ' Create a new FormsAuthenticationUser object.
- Dim newformsAuthenticationUser _
- As New FormsAuthenticationUser(name, password)
-
- '
- '
- ' Using the Password property.
- ' Get current password.
- Dim currentPassword As String = _
- formsAuthenticationUsers(0).Password
-
- ' Set a SHA1 encrypted password.
- ' This example uses the SHA1 algorithm.
- ' Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
- formsAuthenticationUsers(0).Password = _
- "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8"
-
- '
- '
- ' Using the Name property.
- ' Get current name.
- Dim currentName As String = _
- formsAuthenticationUsers(0).Name
-
- ' Set a new name.
- formsAuthenticationUsers(0).Name = "userName"
- '
-
- End Sub
-End Class
-
-
diff --git a/xml/System.Configuration/DpapiProtectedConfigurationProvider.xml b/xml/System.Configuration/DpapiProtectedConfigurationProvider.xml
index 532f210eb75..84fc05199c9 100644
--- a/xml/System.Configuration/DpapiProtectedConfigurationProvider.xml
+++ b/xml/System.Configuration/DpapiProtectedConfigurationProvider.xml
@@ -48,13 +48,13 @@
The uses the Windows built-in cryptographic services and can be configured for either machine-specific or user-account-specific protection. Machine-specific protection is useful for anonymous services but provides less security. User-account-specific protection can be used with services that run with a specific user identity.
-
-
## Examples
- The following example shows how to use the standard to protect or unprotect a configuration section.
+The following example shows how to use the standard to protect or unprotect a configuration section.
+
+The following configuration excerpts show the configuration section before and after the protection is applied.
- The following configuration excerpts show the configuration section before and after the protection has been applied.
+[!INCLUDE[ROPC warning](~/includes/ropc-warning.md)]
```xml
@@ -93,7 +93,6 @@
Cryptographic Services
- Specifying a Protected Configuration Provider
diff --git a/xml/System.Configuration/ProtectedConfigurationProvider.xml b/xml/System.Configuration/ProtectedConfigurationProvider.xml
index 8af872219e8..262ed3b7187 100644
--- a/xml/System.Configuration/ProtectedConfigurationProvider.xml
+++ b/xml/System.Configuration/ProtectedConfigurationProvider.xml
@@ -34,9 +34,10 @@
class uses the to encrypt configuration sections. The class uses the Windows Data Protection API (DPAPI) to encrypt configuration sections.
+You can encrypt sections of a configuration file to protect sensitive information used by your application. This improves security by making it difficult for unauthorized access even if an attacker gains access to your configuration file.
+
+.NET includes two protected configuration providers that can be used to encrypt sections of a configuration file. The class uses the to encrypt configuration sections. The class uses the Windows Data Protection API (DPAPI) to encrypt configuration sections.
You might have a requirement to encrypt sensitive information using an algorithm other than the RSA or DPAPI providers. In this case, you can build your own custom protected-configuration provider. The is an abstract base class that you must inherit from to create your own protected-configuration provider.
@@ -45,14 +46,12 @@
For details, see [Implementing a Protected Configuration Provider](https://learn.microsoft.com/previous-versions/aspnet/wfc2t3az(v=vs.100)).
> [!NOTE]
-> When ASP.NET encounters encrypted configuration data, it performs decryption transparently using the configured provider. No action is required on your side other than making sure that you configure the required provider.
-
-
+> When ASP.NET encounters encrypted configuration data, it performs decryption transparently using the configured provider. No action is required on your side other than making sure that you configure the required provider.
## Examples
The following example shows how to implement a custom .
- To be able to configure this provider, as shown in the next configuration excerpt, you must install it in the Global Assembly Cache (GAC). Refer to [Implementing a Protected Configuration Provider](https://learn.microsoft.com/previous-versions/aspnet/wfc2t3az(v=vs.100)) for more information.
+ To be able to configure this provider, as shown in the next configuration excerpt, you must install it in the Global Assembly Cache (GAC). For more information, see [Implementing a Protected Configuration Provider](https://learn.microsoft.com/previous-versions/aspnet/wfc2t3az(v=vs.100)).
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ProtectedConfigurationProvider/CS/ProtectedConfigurationProviderLib.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ProtectedConfigurationProvider/VB/ProtectedConfigurationProviderLib.vb" id="Snippet1":::
@@ -64,6 +63,8 @@
The following is an excerpt of the configuration file used by the above examples.
+[!INCLUDE[ROPC warning](~/includes/ropc-warning.md)]
+
```xml
diff --git a/xml/System.Data.SqlClient/SqlClientPermission.xml b/xml/System.Data.SqlClient/SqlClientPermission.xml
index f52e882c4a7..df0e73d4ac4 100644
--- a/xml/System.Data.SqlClient/SqlClientPermission.xml
+++ b/xml/System.Data.SqlClient/SqlClientPermission.xml
@@ -44,17 +44,17 @@
Enables the .NET Framework Data Provider for SQL Server to help make sure that a user has a security level sufficient to access a data source.
- property takes precedence over the property. Therefore, if you set to `false`, you must also set to `false` to prevent a user from making a connection using a blank password.
-
+ The property takes precedence over the property. Therefore, if you set to `false`, you must also set to `false` to prevent a user from making a connection using a blank password.
+
> [!NOTE]
-> When using code access security permissions for ADO.NET, the correct pattern is to start with the most restrictive case (no permissions at all) and then add the specific permissions that are needed for the particular task that the code needs to perform. The opposite pattern, starting with all permissions and then denying a specific permission, is not secure, because there are many ways of expressing the same connection string. For example, if you start with all permissions and then attempt to deny the use of the connection string "server=someserver", the string "server=someserver.mycompany.com" would still be allowed. By always starting by granting no permissions at all, you reduce the chances that there are holes in the permission set.
-
+> When using code access security permissions for ADO.NET, the correct pattern is to start with the most restrictive case (no permissions at all) and then add the specific permissions that are needed for the particular task that the code needs to perform. The opposite pattern, starting with all permissions and then denying a specific permission, is not secure, because there are many ways of expressing the same connection string. For example, if you start with all permissions and then attempt to deny the use of the connection string "server=someserver", the string "server=someserver.mycompany.com" would still be allowed. By always starting by granting no permissions at all, you reduce the chances that there are holes in the permission set.
+
]]>
Code Access Security and ADO.NET
@@ -193,11 +193,11 @@
Indicates whether a blank password is allowed.
Initializes a new instance of the class.
- enumeration takes precedence over the property. Therefore, if you set to `false`, you must also set to `None` to prevent a user from making a connection using a blank password. For an example demonstrating how to use security demands, see [Code Access Security and ADO.NET](/dotnet/framework/data/adonet/code-access-security).
-
+ enumeration takes precedence over the property. Therefore, if you set to `false`, you must also set to `None` to prevent a user from making a connection using a blank password. For an example demonstrating how to use security demands, see [Code Access Security and ADO.NET](/dotnet/framework/data/adonet/code-access-security).
+
]]>
Code Access Security and ADO.NET
@@ -243,24 +243,26 @@
One of the enumerations.
Adds a new connection string and a set of restricted keywords to the object.
- [!NOTE]
-> When using code access security permissions for ADO.NET, the correct pattern is to start with the most restrictive case (no permissions at all) and then add the specific permissions that are needed for the particular task that the code needs to perform. The opposite pattern, starting with all permissions and then trying to deny a specific permission, is not secure, because there are many ways of expressing the same connection string. For example, if you start with all permissions and then attempt to deny the use of the connection string "server=someserver", the string "server=someserver.mycompany.com" would still be allowed. By always starting by granting no permissions at all, you reduce the chances that there are holes in the permission set.
-
+> When using code access security permissions for ADO.NET, the correct pattern is to start with the most restrictive case (no permissions at all) and then add the specific permissions that are needed for the particular task that the code needs to perform. The opposite pattern, starting with all permissions and then trying to deny a specific permission, is not secure, because there are many ways of expressing the same connection string. For example, if you start with all permissions and then attempt to deny the use of the connection string "server=someserver", the string "server=someserver.mycompany.com" would still be allowed. By always starting by granting no permissions at all, you reduce the chances that there are holes in the permission set.
+
]]>
Code Access Security and ADO.NET
diff --git a/xml/System.Data.SqlClient/SqlConnection.xml b/xml/System.Data.SqlClient/SqlConnection.xml
index a1de80c25e9..56c54eb59c7 100644
--- a/xml/System.Data.SqlClient/SqlConnection.xml
+++ b/xml/System.Data.SqlClient/SqlConnection.xml
@@ -761,18 +761,21 @@ using (SqlConnection connection = new SqlConnection(connectionString))
method changes the SQL Server password for the user indicated in the supplied `connectionString` parameter to the value supplied in the `newPassword` parameter. If the connection string includes the option for integrated security (that is, "Integrated Security=True" or the equivalent), an exception is thrown.
To determine that the password has expired, calling the method raises a . In order to indicate that the password that is contained within the connection string must be reset, the property for the exception contains the status value 18487 or 18488. The first value (18487) indicates that the password has expired and the second (18488) indicates that the password must be reset before logging in.
- This method opens its own connection to the server, requests the password change, and closes the connection as soon as it has completed. This connection is not retrieved from, nor returned to, the SQL Server connection pool.
+ This method opens its own connection to the server, requests the password change, and closes the connection as soon as it has completed. This connection is not retrieved from or returned to the SQL Server connection pool.
+## Examples
+[!INCLUDE[ROPC warning](~/includes/ropc-warning.md)]
-## Examples
- The following is a simple example of changing a password:
+The following is a simple example of changing a password:
```csharp
class Program {
@@ -782,7 +785,6 @@ class Program {
"new_password");
}
}
-
```
```vb
diff --git a/xml/System.Data.SqlClient/SqlConnectionStringBuilder.xml b/xml/System.Data.SqlClient/SqlConnectionStringBuilder.xml
index 7d79e9b586f..e74785ed9e9 100644
--- a/xml/System.Data.SqlClient/SqlConnectionStringBuilder.xml
+++ b/xml/System.Data.SqlClient/SqlConnectionStringBuilder.xml
@@ -47,13 +47,13 @@
class to build and modify connection strings. The class also makes it easy to manage connection strings stored in an application configuration file.
+ The connection string builder lets developers programmatically create syntactically correct connection strings, and parse and rebuild existing connection strings, using properties and methods of the class. The connection string builder provides strongly typed properties corresponding to the known key/value pairs allowed by SQL Server. If you need to create connection strings as part of your app, you can use the class to build and modify connection strings. The class also makes it easy to manage connection strings stored in an application configuration file.
- The performs checks for valid key/value pairs. Therefore, you cannot use this class to create invalid connection strings; trying to add invalid pairs will throw an exception. The class maintains a fixed collection of synonyms and can translate from a synonym to the corresponding well-known key name.
+ performs checks for valid key/value pairs. Therefore, you cannot use this class to create invalid connection strings; trying to add invalid pairs will throw an exception. The class maintains a fixed collection of synonyms and can translate from a synonym to the corresponding well-known key name.
- For example, when you use the **Item** property to retrieve a value, you can specify a string that contains any synonym for the key you need. For example, you can specify "Network Address", "addr", or any other acceptable synonym for this key within a connection string when you use any member that requires a string that contains the key name, such as the **Item** property or the method. See the property for a full list of acceptable synonyms.
+ For example, when you use the `Item` property to retrieve a value, you can specify a string that contains any synonym for the key you need. For example, you can specify "Network Address", "addr", or any other acceptable synonym for this key within a connection string when you use any member that requires a string that contains the key name, such as the property or the method. See the property for a full list of acceptable synonyms.
- The **Item** property handles tries to insert malicious entries. For example, the following code, using the default Item property (the indexer, in C#) correctly escapes the nested key/value pair:
+ The property handles attempts to insert malicious entries. For example, the following code, using the default `Item` property (the indexer, in C#) correctly escapes the nested key/value pair:
```vb
Dim builder As New System.Data.SqlClient.SqlConnectionStringBuilder
@@ -70,23 +70,18 @@ builder["Data Source"] = "(local)";
builder["integrated Security"] = true;
builder["Initial Catalog"] = "AdventureWorks;NewValue=Bad";
Console.WriteLine(builder.ConnectionString);
-
```
- The result is the following connection string that handles the invalid value in a safe manner:
+The result is the following connection string that handles the invalid value in a safe manner:
```
Source=(local);Initial Catalog="AdventureWorks;NewValue=Bad";
Integrated Security=True
```
-
-
## Examples
- The following console application builds connection strings for a SQL Server database. The code uses a class to create the connection string, and then passes the property of the instance to the constructor of the connection class. The example also parses an existing connection string and demonstrates various ways of manipulating the connection string's contents.
-> [!NOTE]
-> This example includes a password to demonstrate how works with connection strings. In your applications, we recommend that you use Windows Authentication. If you must use a password, do not include a hard-coded password in your application.
+The following console application builds connection strings for a SQL Server database. The code uses the class to create the connection string. The example then parses the connection string and demonstrates various ways of manipulating the its contents.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/CS/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/VB/source.vb" id="Snippet1":::
@@ -2060,54 +2055,44 @@ False
Because the collection of keys supported by the is fixed, every item within the collection has a known default value. The following table lists the keys, and the value for each when the is first initialized, or after the method has been called.
-|Key|Default value|
-|---------|-------------------|
-|Application Name|".Net SqlClient Data Provider"|
-|Asynchronous Processing|False|
-|AttachDBFilename|Empty string|
-|Connection Timeout|15|
-|Context Connection|False|
-|Current Language|Empty string|
-|Data Source|Empty string|
-|Encrypt|False|
-|Enlist|True|
-|Failover Partner|Empty string|
-|Initial Catalog|Empty string|
-|Integrated Security|False|
-|Load Balance Timeout|0|
-|Max Pool Size|100|
-|Min Pool Size|0|
-|MultipleActiveResultSets|False|
-|Network Library|Empty string|
-|Packet Size|8000|
-|Password|Empty string|
-|Persist Security Info|False|
-|Pooling|True|
-|Replication|False|
-|Transaction Binding|Implicit Unbind|
-|User ID|Empty string|
-|User Instance|False|
-|Workstation ID|Empty string|
-
-
+| Key | Default value |
+|--------------------------|--------------------------------|
+| Application Name | ".Net SqlClient Data Provider" |
+| Asynchronous Processing | False |
+| AttachDBFilename | Empty string |
+| Connection Timeout | 15 |
+| Context Connection | False |
+| Current Language | Empty string |
+| Data Source | Empty string |
+| Encrypt | False |
+| Enlist | True |
+| Failover Partner | Empty string |
+| Initial Catalog | Empty string |
+| Integrated Security | False |
+| Load Balance Timeout | 0 |
+| Max Pool Size | 100 |
+| Min Pool Size | 0 |
+| MultipleActiveResultSets | False |
+| Network Library | Empty string |
+| Packet Size | 8000 |
+| Password | Empty string |
+| Persist Security Info | False |
+| Pooling | True |
+| Replication | False |
+| Transaction Binding | Implicit Unbind |
+| User ID | Empty string |
+| User Instance | False |
+| Workstation ID | Empty string |
## Examples
- The following example converts an existing connection string from using Windows Authentication to using integrated security. The example works by removing the user name and password from the connection string, and then setting the property of the object.
-> [!NOTE]
-> This example includes a password to demonstrate how works with connection strings. In your applications, we recommend that you use Windows Authentication. If you must use a password, do not include a hard-coded password in your application.
+The following example converts an existing connection string from using SQL Server Authentication to Windows Authentication (integrated security). The example works by removing the user name and password from the connection string, and then setting the property of the object.
+
+[!INCLUDE[ROPC warning](~/includes/ropc-warning.md)]
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/CS/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/VB/source.vb" id="Snippet1":::
- The example displays the following text in the console window:
-
-```
-Original: Data Source=(local);Initial Catalog=AdventureWorks;User ID=ab;Password= a1Pass@@11
-Modified: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True
-Database = AdventureWorks
-```
-
]]>
diff --git a/xml/System.Web.Configuration/AuthenticationSection.xml b/xml/System.Web.Configuration/AuthenticationSection.xml
index 97428c6fc7d..2627c2d2ec8 100644
--- a/xml/System.Web.Configuration/AuthenticationSection.xml
+++ b/xml/System.Web.Configuration/AuthenticationSection.xml
@@ -23,38 +23,17 @@
The class provides a way to programmatically access and modify the `authentication` section of a configuration file.
> [!NOTE]
-> The can write information into the related section of the configuration file according to the restrictions defined by the section property whose value is . Any attempt to write in a configuration file at a level not allowed in the hierarchy will result in an error message generated by the parser. However, you can use this class to read configuration information at any level in the hierarchy. For safety and scalability, it is recommended that you use an external repository, such as a database, to keep the users' credentials.
-
-
+> The can write information into the related section of the configuration file according to the restrictions defined by the section property whose value is . Any attempt to write in a configuration file at a level not allowed in the hierarchy will result in an error message generated by the parser. However, you can use this class to read configuration information at any level in the hierarchy. For safety and scalability, it's recommended that you use an external repository, such as a database, to keep the users' credentials.
## Examples
- This section provides two code examples. The first demonstrates how to specify values declaratively for several attributes of the `authentication` section, which can also be accessed as members of the class. The second demonstrates how to use the class.
-
- The following configuration file example shows how to specify values declaratively for the `authentication` section.
-
-> [!NOTE]
-> If you use the `credentials` section, be sure to follow the guidelines explained at [ASP.NET Authentication](https://learn.microsoft.com/previous-versions/aspnet/eeyk640h(v=vs.100)). For scalability and better security, it is recommended the use of an external database to store the users' credentials.
-
-```
-
-
-
-
-
-
-
-
-```
- This example uses SHA1. Due to collision problems with SHA1, Microsoft recommends SHA256.
-
- The following code example demonstrates how to use the class.
+This example demonstrates how to use the class.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/CS/authenticationsection.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/VB/authenticationsection.vb" id="Snippet1":::
+[!INCLUDE[Forms authentication warning](~/includes/forms-auth-warning.md)]
+
]]>
diff --git a/xml/System.Web.Configuration/FormsAuthPasswordFormat.xml b/xml/System.Web.Configuration/FormsAuthPasswordFormat.xml
index f7d23866733..746229d354d 100644
--- a/xml/System.Web.Configuration/FormsAuthPasswordFormat.xml
+++ b/xml/System.Web.Configuration/FormsAuthPasswordFormat.xml
@@ -17,19 +17,11 @@
Defines the encryption format for storing passwords.
- class. This class is also used internally by in the processing of authentication tickets.
-
-
-
-## Examples
- The following code example shows how to use the enumeration. Refer to the code example in the class topic to learn how to get the collection.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet3":::
-
+ class. This class is also used internally by in the processing of authentication tickets.
+
]]>
diff --git a/xml/System.Web.Configuration/FormsAuthenticationConfiguration.xml b/xml/System.Web.Configuration/FormsAuthenticationConfiguration.xml
index efbd2384a7c..788ba679183 100644
--- a/xml/System.Web.Configuration/FormsAuthenticationConfiguration.xml
+++ b/xml/System.Web.Configuration/FormsAuthenticationConfiguration.xml
@@ -24,43 +24,20 @@
This type is part of a group that includes the ,the , and the types. The types other than the collection type directly affect the underlying configuration tags.
-> [!NOTE]
-> The can write information into the related section of the configuration file according to the restrictions defined by the section property whose value is . Any attempt to write in a configuration file at a level not allowed in the hierarchy will result in an error message generated by the parser. However, you can use this class to read configuration information at any level in the hierarchy. For safety and scalability, it is recommended that you use an external repository, such as a database, to keep the users' credentials.
-
+[!INCLUDE[Forms authentication warning](~/includes/forms-auth-warning.md)]
+> [!NOTE]
+> The can write information into the related section of the configuration file according to the restrictions defined by the section property whose value is . Any attempt to write in a configuration file at a level not allowed in the hierarchy will result in an error message generated by the parser. However, you can use this class to read configuration information at any level in the hierarchy. For safety and scalability, it is recommended that you use [Azure Key Vault](/azure/key-vault/general/overview) to store user credentials.
## Examples
- The following code example shows how to obtain the object from the configuration file of an existing Web application. You can use this object to access its members. The configuration file will contain a setup similar to the following.
-
- **Note** If you use the `credentials` section, be sure to follow the guidelines explained at [ASP.NET Authentication](https://learn.microsoft.com/previous-versions/aspnet/eeyk640h(v=vs.100)). For scalability and better security, it is recommended that you use an external database to store the users' credentials. For more information about building secure ASP.NET applications see [Securing Your ASP.NET Application](https://learn.microsoft.com/archive/msdn-magazine/2012/january/asp-net-security-securing-your-asp-net-applications) and [Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication](https://learn.microsoft.com/previous-versions/msp-n-p/ff649357(v=pandp.10)).
-
- This example uses SHA1. Due to collision problems with SHA1, Microsoft recommends SHA256.
-
-```
-
-
-
-
-
-
-
-
-```
+
+ The following code example shows how to obtain the object from the configuration file of an existing Web application. You can use this object to access its members.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/CS/formsauthenticationconfiguration.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/VB/formsauthenticationconfiguration.vb" id="Snippet1":::
]]>
- ASP.NET Authentication
- Forms Authentication Provider
- Forms Authentication Across Applications
@@ -201,16 +178,7 @@
## Remarks
The property gets the user names and passwords to use during forms-based authentication.
-> [!NOTE]
-> When security is required, you should use alternative ways of storing the user names and passwords; for example, in a database store. If you decide to use this collection, you should use the provided encryption facility.
-
-
-
-## Examples
- The following code example shows how to access the property. Refer to the code example in the class topic to learn how to get the section.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/CS/formsauthenticationconfiguration.cs" id="Snippet14":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationConfiguration/VB/formsauthenticationconfiguration.vb" id="Snippet14":::
+[!INCLUDE[Forms authentication warning](~/includes/forms-auth-warning.md)]
]]>
diff --git a/xml/System.Web.Configuration/FormsAuthenticationCredentials.xml b/xml/System.Web.Configuration/FormsAuthenticationCredentials.xml
index 33160f48e65..4bdf7cc7a16 100644
--- a/xml/System.Web.Configuration/FormsAuthenticationCredentials.xml
+++ b/xml/System.Web.Configuration/FormsAuthenticationCredentials.xml
@@ -22,41 +22,13 @@
## Remarks
The class provides a way to programmatically access and modify the `credentials` element of a `forms` section in the `authentication` section of the configuration file. This type is part of a group that includes the , the , and the types. With the exception of the collection type, all the others directly affect the underlying configuration tags.
-> [!NOTE]
-> The can write information into the related section of the configuration file according to the restrictions defined by . Any attempt to write in a configuration file at a level not allowed in the hierarchy will result in an error message generated by the parser. However, you can use this class to read configuration information at any level in the hierarchy. For safety and scalability, it is recommended that you use an external repository, such as a database, to keep the users' credentials.
-
-
-
-## Examples
- This example demonstrates how to specify values declaratively for several attributes of the `credentials` section, which can also be accessed as members of the class.
-
- The following configuration file example shows how to specify values declaratively for the `credentials` section.
-
-```
-
-
-
-
-```
-
- This example uses SHA1. Due to collision problems with SHA1, Microsoft recommends SHA256.
+[!INCLUDE[Forms authentication warning](~/includes/forms-auth-warning.md)]
> [!NOTE]
-> If you use the `credentials` section, be sure to follow the guidelines explained at [ASP.NET Authentication](https://learn.microsoft.com/previous-versions/aspnet/eeyk640h(v=vs.100)). For scalability and better security, it is recommended that you use an external database to store the users' credentials. For more information about building secure ASP.NET applications, see [Securing Your ASP.NET Application](https://learn.microsoft.com/archive/msdn-magazine/2012/january/asp-net-security-securing-your-asp-net-applications) and [Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication](https://learn.microsoft.com/previous-versions/msp-n-p/ff649202(v=pandp.10)).
-
- The following code example demonstrates how to use the class.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet1":::
+> The can write information into the related section of the configuration file according to the restrictions defined by . Any attempt to write in a configuration file at a level not allowed in the hierarchy will result in an error message generated by the parser. However, you can use this class to read configuration information at any level in the hierarchy. For safety and scalability, it's recommended that you use [Azure Key Vault](/azure/key-vault/general/overview) to store user credentials.
]]>
- ASP.NET Authentication
- Forms Authentication Credentials
- Forms Authentication Provider
- Forms Authentication Across Applications
@@ -80,17 +52,7 @@
Initializes a new instance of the class.
-
- object.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet2":::
-
- ]]>
-
+ To be added.
@@ -118,17 +80,7 @@
Gets or sets the password format.
One of the values.
-
- property. Refer to the code example in the class topic to learn how to get the section.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet3":::
-
- ]]>
-
+ To be added.
@@ -185,17 +137,7 @@
Gets the users' names and password credentials.
A that contains the users' names and password credentials.
-
- property. Refer to the code example in the class topic to learn how to get the section.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet4":::
-
- ]]>
-
+ To be added.
diff --git a/xml/System.Web.Configuration/FormsAuthenticationUser.xml b/xml/System.Web.Configuration/FormsAuthenticationUser.xml
index 8a3522cc82b..63154f67c16 100644
--- a/xml/System.Web.Configuration/FormsAuthenticationUser.xml
+++ b/xml/System.Web.Configuration/FormsAuthenticationUser.xml
@@ -24,44 +24,13 @@
This type is part of a group that includes the , the , and the types. The types other than the collection type directly affect the underlying configuration tags.
-> [!NOTE]
-> The can write information into the related section of the configuration file at machine, site, or application level only. Any attempt to write in a configuration file at a different level in the hierarchy will result in an error message generated by the parser. However, you can use this class to read configuration information at any level in the hierarchy. For safety and scalability, it is recommended that you use an external repository, such as a database, to keep the users' credentials.
-
-
-
-## Examples
- The following code example shows how to obtain the to access the objects of an existing Web application. The configuration file will contain a setup similar to the following.
+[!INCLUDE[Forms authentication warning](~/includes/forms-auth-warning.md)]
> [!NOTE]
-> If you use the [credentials Element for forms for authentication (ASP.NET Settings Schema)](https://msdn.microsoft.com/library/e5a001f8-fdbe-4c88-80ca-bfe36df23479) section, be sure to follow the guidelines explained at [ASP.NET Authentication](https://learn.microsoft.com/previous-versions/aspnet/eeyk640h(v=vs.100)). For scalability and better security, it is recommended you use an external database to store the users' credentials. For more information about building secure ASP.NET applications, see [Securing Your ASP.NET Application](https://learn.microsoft.com/archive/msdn-magazine/2012/january/asp-net-security-securing-your-asp-net-applications) and [Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication](https://learn.microsoft.com/previous-versions/msp-n-p/ff649357(v=pandp.10)).
-
- This example uses SHA1. Due to collision problems with SHA1, Microsoft recommends SHA256.
-
-```
-
-
- defaultUrl="formsdefault.aspx"
- protection="Encryption" timeout="5" path="aspnet"
- slidingExpiration="false"
- cookieless="UseCookies" domain="domainName">
-
-
-
-
-
-
-```
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/CS/formsauthenticationuser.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/VB/formsauthenticationuser.vb" id="Snippet1":::
+> The can write information into the related section of the configuration file at machine, site, or application level only. Any attempt to write in a configuration file at a different level in the hierarchy will result in an error message generated by the parser. However, you can use this class to read configuration information at any level in the hierarchy. For safety and scalability, it is recommended that you use [Azure Key Vault](/azure/key-vault/general/overview) to store user credentials.
]]>
- ASP.NET Authentication
- Forms Authentication Provider
- Forms Authentication Across Applications
@@ -85,22 +54,7 @@
User's name.
User's password.
Initializes a new instance of the class using the passed parameters.
-
- object using the passed parameters.
-
-
-
-## Examples
- The following code example shows how to create a object.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/CS/formsauthenticationuser.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/VB/formsauthenticationuser.vb" id="Snippet3":::
-
- ]]>
-
+ To be added.
@@ -136,17 +90,7 @@
Gets or sets the logon user name.
The logon user name required by the application.
-
- property. Refer to the code example in the class topic to learn how to get the section.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/CS/formsauthenticationuser.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/VB/formsauthenticationuser.vb" id="Snippet5":::
-
- ]]>
-
+ To be added.
@@ -178,17 +122,7 @@
Gets or sets the user's password.
The user's password required by the application.
-
- property. Refer to the code example in the class topic to learn how to get the section.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/CS/formsauthenticationuser.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationUser/VB/formsauthenticationuser.vb" id="Snippet4":::
-
- ]]>
-
+ To be added.
diff --git a/xml/System.Web.Configuration/FormsAuthenticationUserCollection.xml b/xml/System.Web.Configuration/FormsAuthenticationUserCollection.xml
index 6cabe6cffcc..907d25133b5 100644
--- a/xml/System.Web.Configuration/FormsAuthenticationUserCollection.xml
+++ b/xml/System.Web.Configuration/FormsAuthenticationUserCollection.xml
@@ -30,16 +30,7 @@
This type is part of a group that includes the , the , and the types.
-
-
-## Examples
- The following code example shows how to obtain the object from the configuration file of an existing Web application.
-
-> [!NOTE]
-> If you use the `credentials` element be sure to follow the guidelines explained at [ASP.NET Authentication](https://learn.microsoft.com/previous-versions/aspnet/eeyk640h(v=vs.100)). For scalability and better security, it is recommended you use an external database to store the users' credentials. For more information about building secure ASP.NET applications, see [Securing Your ASP.NET Application](https://learn.microsoft.com/archive/msdn-magazine/2012/january/asp-net-security-securing-your-asp-net-applications) and [Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication](https://learn.microsoft.com/previous-versions/msp-n-p/ff649357(v=pandp.10)).
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet1":::
+[!INCLUDE[Forms authentication warning](~/includes/forms-auth-warning.md)]
]]>
@@ -101,14 +92,6 @@
## Remarks
The collection must not contain a object with the same name.
-
-
-## Examples
- The following code example shows how to use the method.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet6":::
-
]]>
The object already exists in the collection, or the collection is read-only.
@@ -139,14 +122,6 @@
## Remarks
You can use this method to access the objects contained in the collection.
-
-
-## Examples
- The following code example shows how to use the property.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet17":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet17":::
-
]]>
@@ -176,14 +151,6 @@
## Remarks
This method inserts a `clear` directive into the appropriate section of the configuration file to clear all references to elements defined in a higher-level configuration file. All elements defined in the appropriate section of the current configuration file are removed.
-
-
-## Examples
- The following code example shows how to use the method.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet7":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet7":::
-
]]>
The collection is read-only.
@@ -288,17 +255,7 @@
The collection user's index.
Gets the collection element at the specified index.
A that contains the user name and password.
-
-
-
+ To be added.
@@ -324,17 +281,7 @@
The user's name.
Gets the collection element with the specified name.
A object that contains the user name and password.
-
-
-
+ To be added.
@@ -386,17 +333,7 @@
The index in the collection.
Gets the key at the specified collection index.
The key at the specified index of the .
-
- method.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet14":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet14":::
-
- ]]>
-
+ To be added.
@@ -431,17 +368,7 @@
The collection user's index.
Gets the at the specified index.
A that contains the user name and password.
-
-
-
+ To be added.
@@ -467,17 +394,7 @@
The user's name.
Gets the with the specified name.
A object that contains the user name and password.
-
-
-
+ To be added.
@@ -536,14 +453,6 @@
## Remarks
This method inserts a `remove` element into the appropriate section of the configuration file for any element defined in a higher-level configuration file. If the element is defined in the appropriate section of the current configuration file, its entry is removed from the configuration file. The object to remove must exist in the collection.
-
-
-## Examples
- The following code example shows how to use the method.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet9":::
-
]]>
There is no object with the specified key in the collection, the element has already been removed, or the collection is read-only.
@@ -577,14 +486,6 @@
## Remarks
This method inserts a `remove` element into the appropriate section of the configuration file for any element defined in a higher-level configuration file. If the element is defined in the appropriate section of the current configuration file, its entry is removed from the configuration file. The object to remove must exist in the collection.
-
-
-## Examples
- The following code example shows how to use the method.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet10":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet10":::
-
]]>
There is no object at the specified index in the collection, the element has already been removed, or the collection is read only.
@@ -612,17 +513,7 @@
The object that must be changed.
Modifies the specified object contained in the collection.
-
- method.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet11":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet11":::
-
- ]]>
-
+ To be added.
diff --git a/xml/System.Web.Configuration/OutputCacheProfileCollection.xml b/xml/System.Web.Configuration/OutputCacheProfileCollection.xml
index 39d0e7cc94d..b088aa16998 100644
--- a/xml/System.Web.Configuration/OutputCacheProfileCollection.xml
+++ b/xml/System.Web.Configuration/OutputCacheProfileCollection.xml
@@ -573,14 +573,6 @@
## Remarks
The method modifies an existing element.
-
-
-## Examples
- The following code example shows how to use the method.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/CS/formsauthenticationcredentials.cs" id="Snippet10":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.FormsAuthenticationCredentials/VB/formsauthenticationcredentials.vb" id="Snippet10":::
-
]]>
The is read-only.
diff --git a/xml/System.Web.Configuration/ProcessModelSection.xml b/xml/System.Web.Configuration/ProcessModelSection.xml
index aee610a1fc4..b35a3287774 100644
--- a/xml/System.Web.Configuration/ProcessModelSection.xml
+++ b/xml/System.Web.Configuration/ProcessModelSection.xml
@@ -17,47 +17,45 @@
Configures the ASP.NET process model settings on an Internet Information Services (IIS) Web server. This class cannot be inherited.
- class provides a way to programmatically access and modify the `processModel` section of a configuration file.
-
- The class controls various aspects of the ASP.NET worker process, including its lifetime, the number of instances created at a time, what security identity it runs under, and the size of the CLR thread pool to service requests.
-
- When ASP.NET is running under IIS 6 in native mode, ASP.NET uses the IIS 6 process model and ignores most settings in this section. Use the IIS administration user interface (UI) to configure those properties. ASP.NET still uses the following properties, which can be configured through the configuration file: , , , , , and .
-
- The `processModel` section cannot be encrypted using the protected-configuration feature or tools because it is consumed by the ASP.NET ISAPI extension.
-
-
-
-## Examples
- This example demonstrates how to specify values declaratively for several attributes of the `processModel` section, which can also be accessed as members of the class.
-
- The following configuration file example shows how to specify values declaratively for the `processModel` section.
-
-```
-
-```
-
- The following code example demonstrates how to use the class.
-
+ class provides a way to programmatically access and modify the `processModel` section of a configuration file.
+
+ The class controls various aspects of the ASP.NET worker process, including its lifetime, the number of instances created at a time, what security identity it runs under, and the size of the CLR thread pool to service requests.
+
+ When ASP.NET is running under IIS 6 in native mode, ASP.NET uses the IIS 6 process model and ignores most settings in this section. Use the IIS administration user interface (UI) to configure those properties. ASP.NET still uses the following properties, which can be configured through the configuration file: , , , , , and .
+
+ The `processModel` section cannot be encrypted using the protected-configuration feature or tools because it is consumed by the ASP.NET ISAPI extension.
+
+## Examples
+ This example demonstrates how to specify values declaratively for several attributes of the `processModel` section, which can also be accessed as members of the class.
+
+ The following configuration file example shows how to specify values declaratively for the `processModel` section.
+
+```
+
+```
+
+ The following code example demonstrates how to use the class.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet1":::
+
]]>
@@ -88,11 +86,11 @@
Initializes a new instance of the class using default settings.
- constructor is not intended to be used directly from your code. It is called by the ASP.NET configuration system. You obtain an instance of the class by using the method.
-
+ constructor is not intended to be used directly from your code. It is called by the ASP.NET configuration system. You obtain an instance of the class by using the method.
+
]]>
@@ -125,13 +123,13 @@
if performance settings are automatically configured for ASP.NET applications; otherwise, . The default value is .
- value is set to `false`, explicit Web.config values are used to determine performance configuration for the ASP.NET application. If the value is set to `true`, the performance settings are automatically configured for the ASP.NET application.
-
- The value is explicitly set to `true` in the Machine.config file. The default code value is set to `false`. If the value is removed from Machine.config, the explicit settings are used instead of the auto-configured settings.
-
+ value is set to `false`, explicit Web.config values are used to determine performance configuration for the ASP.NET application. If the value is set to `true`, the performance settings are automatically configured for the ASP.NET application.
+
+ The value is explicitly set to `true` in the Machine.config file. The default code value is set to `false`. If the value is removed from Machine.config, the explicit settings are used instead of the auto-configured settings.
+
]]>
@@ -171,22 +169,22 @@
Gets or sets a value indicating how long a request is left in the queue.
A value indicating the queuing time. The default value is 5 seconds.
- [!NOTE]
-> If the interval expires while the request is still queued, a client connected check is done before passing the request over to the ASP.NET worker process for handling.
-
-
-
-## Examples
- The following code example shows how to access and modify the property.
-
+> If the interval expires while the request is still queued, a client connected check is done before passing the request over to the ASP.NET worker process for handling.
+
+
+
+## Examples
+ The following code example shows how to access and modify the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet18":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet18":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet18":::
+
]]>
@@ -217,19 +215,19 @@
Gets or sets a value indicating the level of authentication for DCOM security.
One of the values. The default value is .
- , DCOM determines the authentication level using its normal security-negotiation algorithm. The default value assigned to this property, as specified in the Machine.config file, is . In this case, DCOM authenticates the credentials of the client only when the client establishes a relationship with the server.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+ , DCOM determines the authentication level using its normal security-negotiation algorithm. The default value assigned to this property, as specified in the Machine.config file, is . In this case, DCOM authenticates the credentials of the client only when the client establishes a relationship with the server.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet21":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet21":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet21":::
+
]]>
@@ -260,19 +258,19 @@
Gets or sets a value indicating the level of authentication for COM security.
One of the values. The default value is .
- , DCOM determines the impersonation level using its normal security-negotiation algorithm. The default value assigned to this property, as specified in the Machine.config file, is . In this case, the server process can impersonate the client's security context while acting on behalf of the client.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+ , DCOM determines the impersonation level using its normal security-negotiation algorithm. The default value assigned to this property, as specified in the Machine.config file, is . In this case, the server process can impersonate the client's security context while acting on behalf of the client.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet22":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet22":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet22":::
+
]]>
@@ -303,19 +301,19 @@
Gets or sets a value indicating which processors on a multiprocessor server are eligible to run ASP.NET processes.
The number representing the bit pattern to apply. The default value is 0xFFFFFFFF.
- value specifies a bit pattern that indicates the CPUs eligible to run ASP.NET threads. If the property is set to `true`, the limits worker processes to the number of eligible CPUs. The maximum allowed number of worker processes is equal to the number of CPUs. By default, all CPUs are enabled and ASP.NET launches one process for each CPU. If the property is set to `false`, the attribute is ignored and only one worker process will run.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+ value specifies a bit pattern that indicates the CPUs eligible to run ASP.NET threads. If the property is set to `true`, the limits worker processes to the number of eligible CPUs. The maximum allowed number of worker processes is equal to the number of CPUs. By default, all CPUs are enabled and ASP.NET launches one process for each CPU. If the property is set to `false`, the attribute is ignored and only one worker process will run.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet25":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet25":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet25":::
+
]]>
@@ -375,22 +373,22 @@
if the process model is enabled; otherwise, . The default value is .
- property specifies whether ASP.NET is hosted in an external worker process. If is `true`, ASP.NET is hosted in an external worker process; otherwise, it runs directly in Inetinfo.exe.
-
+ property specifies whether ASP.NET is hosted in an external worker process. If is `true`, ASP.NET is hosted in an external worker process; otherwise, it runs directly in Inetinfo.exe.
+
> [!NOTE]
-> Running ASP.NET in Inetinfo.exe is not recommended, because this involves running the application in the Local System security context. When ASP.NET runs in Internet Information Services (IIS) 6 native mode, this setting is ignored, so there is usually no reason to set it to `false`.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+> Running ASP.NET in Inetinfo.exe is not recommended, because this involves running the application in the Local System security context. When ASP.NET runs in Internet Information Services (IIS) 6 native mode, this setting is ignored, so there is usually no reason to set it to `false`.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet2":::
+
]]>
@@ -425,19 +423,19 @@
Gets or sets a value indicating the period of inactivity after which ASP.NET automatically ends the worker process.
A value indicating the idle time. The default value is Infinite, which corresponds to TimeSpan.MaxValue.
- property value is reached. By default, only two conditions cause the process to bounce: the process exceeds the allowed memory limit, or the process exceeds the allowed number of requests that can be queued. You can add other conditions to the default ones. For example, you can use the property to limit the time the worker process is idle.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+ property value is reached. By default, only two conditions cause the process to bounce: the process exceeds the allowed memory limit, or the process exceeds the allowed number of requests that can be queued. You can add other conditions to the default ones. For example, you can use the property to limit the time the worker process is idle.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet16":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet16":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet16":::
+
]]>
@@ -468,19 +466,19 @@
Gets or sets a value indicating the event types to be logged to the event log.
One of the values. The default value is .
- property.
-
+ property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet23":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet23":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet23":::
+
]]>
@@ -516,19 +514,19 @@
Gets or sets the maximum allowed number of application domains in one process.
The maximum allowed number of application domains in one process.
- threshold is exceeded, the least-used application domain is shut down if a new application domain must start.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+ threshold is exceeded, the least-used application domain is shut down if a new application domain must start.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet27":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet27":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet27":::
+
]]>
@@ -563,28 +561,28 @@
Gets or sets a value indicating the maximum number of I/O threads per CPU in the CLR thread pool.
The maximum number of threads. The default is 20.
- must be equal to or greater than the setting in the `httpRuntime` configuration section.
-
- You can have some control over the CPU utilization by setting the number of worker threads and I/O threads, using the property and the property respectively.
-
- The difference between the two types of threads is that the latter are bound to I/O objects, such as a stream or a pipe, and the former are traditional unrestricted threads. For Internet Information Services (IIS) version 6.0 and later, ASP.NET processes requests on worker threads. This is because ASP.NET is integrated within IIS.
-
- These threads are obtained from the process-wide CLR thread pool belonging to an application.
-
+ must be equal to or greater than the setting in the `httpRuntime` configuration section.
+
+ You can have some control over the CPU utilization by setting the number of worker threads and I/O threads, using the property and the property respectively.
+
+ The difference between the two types of threads is that the latter are bound to I/O objects, such as a stream or a pipe, and the former are traditional unrestricted threads. For Internet Information Services (IIS) version 6.0 and later, ASP.NET processes requests on worker threads. This is because ASP.NET is integrated within IIS.
+
+ These threads are obtained from the process-wide CLR thread pool belonging to an application.
+
> [!NOTE]
-> Usually the default values for the allowed threads are sufficient to keep the CPU utilization high. If for some reason your application is slow, perhaps waiting for external resources, you could try to increase the number of threads to a value less than 100.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+> Usually the default values for the allowed threads are sufficient to keep the CPU utilization high. If for some reason your application is slow, perhaps waiting for external resources, you could try to increase the number of threads to a value less than 100.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet5":::
+
]]>
@@ -620,28 +618,28 @@
Gets or sets a value indicating the maximum amount of worker threads per CPU in the CLR thread pool.
The maximum number of threads. The default is 20.
- must be equal to or greater than the setting in the `httpRuntime` configuration section.
-
- You can have some control over the CPU utilization by setting the number of worker threads and I/O threads, using the property and, the property, respectively.
-
- The difference between the two types of threads is that the latter are bound to I/O objects, such as a stream or a pipe, and the former are traditional unrestricted threads. For Internet Information Services (IIS) version 6.0 and higher, ASP.NET processes requests on worker threads. This is because ASP.NET is integrated within IIS.
-
- These threads are obtained from the process-wide CLR thread pool belonging to an application.
-
+ must be equal to or greater than the setting in the `httpRuntime` configuration section.
+
+ You can have some control over the CPU utilization by setting the number of worker threads and I/O threads, using the property and, the property, respectively.
+
+ The difference between the two types of threads is that the latter are bound to I/O objects, such as a stream or a pipe, and the former are traditional unrestricted threads. For Internet Information Services (IIS) version 6.0 and higher, ASP.NET processes requests on worker threads. This is because ASP.NET is integrated within IIS.
+
+ These threads are obtained from the process-wide CLR thread pool belonging to an application.
+
> [!NOTE]
-> Usually the default values for the allowed threads are sufficient to keep the CPU utilization high. If for some reason your application is slow, perhaps waiting for external resources, you could try to increase the number of threads to a value less than 100.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+> Usually the default values for the allowed threads are sufficient to keep the CPU utilization high. If for some reason your application is slow, perhaps waiting for external resources, you could try to increase the number of threads to a value less than 100.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet7":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet7":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet7":::
+
]]>
@@ -673,19 +671,19 @@
Gets or sets a value indicating the maximum allowed memory size.
The percentage of the total system memory. The default is 60 percent.
- property.
-
+ property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet3":::
+
]]>
@@ -720,14 +718,14 @@
Gets or sets the minimum number of I/O threads per CPU in the CLR thread pool.
The minimum number of I/O threads per CPU in the CLR thread pool.
- property.
-
+ property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet4":::
+
]]>
@@ -762,14 +760,14 @@
Gets or sets the minimum number of worker threads per CPU in the CLR thread pool.
The minimum number of worker threads per CPU in the CLR thread pool.
- property.
-
+ property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet6":::
+
]]>
@@ -800,21 +798,21 @@
Gets or sets a value indicating the password to use for the Windows identity.
The password to use. The default value is AutoGenerate.
- property must be used with the property.
-
- When present, these property values cause the worker process to run with the configured Windows identity.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+ property must be used with the property.
+
+ When present, these property values cause the worker process to run with the configured Windows identity.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet20":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet20":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet20":::
+
]]>
Encrypting Configuration Information using Protected Configuration
@@ -850,19 +848,19 @@
Gets or sets a value indicating the time interval at which the ISAPI extension pings the worker process to determine whether it is running.
The defining the time interval. The default is 30 seconds.
- interval has expired.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+ interval has expired.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet13":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet13":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet13":::
+
]]>
@@ -897,19 +895,19 @@
Gets or sets a value indicating the time interval after which a non-responsive worker process is restarted.
The defining the time interval. The default is 5 seconds.
- interval. If the worker process does not respond within the interval, the process is restarted.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+ interval. If the worker process does not respond within the interval, the process is restarted.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet14":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet14":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet14":::
+
]]>
@@ -976,19 +974,19 @@
Gets or sets a value indicating the number of requests allowed before a worker process is recycled.
The number of allowed requests. The default is Infinite.
- property.
-
+ property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet8":::
+
]]>
@@ -1027,19 +1025,19 @@
Gets or sets a value indicating the number of requests allowed in the queue.
The number of requests allowed to be queued. The default is 5000.
- property.
-
+ property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet10":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet10":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet10":::
+
]]>
@@ -1078,19 +1076,19 @@
Gets or sets a value indicating the time interval for the worker process to respond.
The defining the interval. The default is 3 minutes.
- .
-
-
-
-## Examples
- The following code example shows how to use the property.
-
+ .
+
+
+
+## Examples
+ The following code example shows how to use the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet17":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet17":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet17":::
+
]]>
@@ -1125,19 +1123,19 @@
No longer used.
Not applicable.
- property.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+ property.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet11":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet11":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet11":::
+
]]>
@@ -1176,19 +1174,19 @@
Gets or sets a value indicating the maximum number of requests queued by the ISAPI while waiting for a new worker process to start handling the requests.
The number of requests queued. The default is 10.
- property.
-
+ property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet9":::
+
]]>
@@ -1219,21 +1217,21 @@
Gets or sets a value indicating the file whose content must be used when a fatal error occurs.
The path of the file used when a fatal error occurs.
- property.
-
+ property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet28":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet28":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet28":::
+
]]>
@@ -1272,19 +1270,19 @@
Gets or sets a value indicating the time allowed for the worker process to shut down.
The defining the interval. The default is 5 seconds.
- property.
-
+ property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet15":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet15":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet15":::
+
]]>
@@ -1319,19 +1317,19 @@
Gets or sets a value indicating the number of minutes until ASP.NET launches a new worker process.
The defining the interval. The default is Infinite.
- property.
-
+ property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet10":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet10":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet10":::
+
]]>
@@ -1362,28 +1360,28 @@
Gets or sets a value indicating the user name for a Windows identity.
The user name. The default value is Machine.
- defines a Windows identity different from that of the default process. This identity is used to run the ASP.NET worker process.
-
- By default, is set to the special value Machine, and the process runs under a user account named ASPNET that is created automatically when ASP.NET is installed.
-
- The property must be used with the property.
-
- When present, these property values cause the worker process to run with the configured Windows identity.
-
+ defines a Windows identity different from that of the default process. This identity is used to run the ASP.NET worker process.
+
+ By default, is set to the special value Machine, and the process runs under a user account named ASPNET that is created automatically when ASP.NET is installed.
+
+ The property must be used with the property.
+
+ When present, these property values cause the worker process to run with the configured Windows identity.
+
> [!NOTE]
-> If the property is set to System, with the password AutoGenerate, it defines an entity that runs the process as an administrative account and allows all ASP.NET user code running under the process to have full administrative privileges. So, pay close attention to this case, for the permissions allowed.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+> If the property is set to System, with the password AutoGenerate, it defines an entity that runs the process as an administrative account and allows all ASP.NET user code running under the process to have full administrative privileges. So, pay close attention to this case, for the permissions allowed.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet19":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet19":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet19":::
+
]]>
@@ -1415,24 +1413,24 @@
, if is used to map the worker processes to the number of eligible CPUs; if is ignored.
- property must be used with the property.
-
- If the property is set to `false`, the attribute is ignored and only one worker process runs.
-
+ property must be used with the property.
+
+ If the property is set to `false`, the attribute is ignored and only one worker process runs.
+
> [!NOTE]
-> A multiprocessor Web server is called a Web garden.
-
-
-
-## Examples
- The following code example shows how to access the property.
-
+> A multiprocessor Web server is called a Web garden.
+
+
+
+## Examples
+ The following code example shows how to access the property.
+
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/CS/processmodelsection.cs" id="Snippet24":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet24":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.ProcessModelSection/VB/processmodelsection.vb" id="Snippet24":::
+
]]>