Create a WebPermission class with the specified access rights for the specified URI regular expression.
using System;
using System.Net;
using System.Net.Sockets;
using System.Text.RegularExpressions;
class MainClass
{
publicstaticvoid Main()
{
Regex myRegex = new Regex(@"http://www\.google\.com/.*");
WebPermission myWebPermission = new WebPermission(NetworkAccess.Connect, myRegex);
myWebPermission.Demand();
}
}