Adds the specified URI with the specified access rights to the current System.Net.WebPermission.
If you have specified System.Security.Permissions.PermissionState.None as the System.Security.Permissions.PermissionState, use WebPermission.AddPermission(NetworkAccess, string) to allow the use of uriRegex in the target class. Specify NetworkAccess.Accept as the access parameter to add the URI specified by the uriRegex parameter to the list of URI accept strings, or specify NetworkAccess.Connect as the access parameter to add the URI to the list of URI connect strings.
Calling WebPermission.AddPermission(NetworkAccess, string) on an System.Security.Permissions.PermissionState.Unrestricted System.Net.WebPermission instance will have no effect as permission is granted to all URIs.
It is recommended that you create uriRegex using the System.Text.RegularExpressions.RegexOptions.IgnoreCase, System.Text.RegularExpressions.RegexOptions.Compiled, and System.Text.RegularExpressions.RegexOptions.Singleline flags.
A candidate URI string is checked against the list of relevant regular expressions (WebPermission.AcceptList or WebPermission.ConnectList) in two ways. First, the candidate URI string is checked against the appropriate list; then, if there is no match, the candidate URI string is converted into a Uri and checked against the appropriate list.