diff --git a/snippets/cpp/VS_Snippets_Remoting/WebRequest_PreAuthenticate/CPP/webrequest_preauthenticate.cpp b/snippets/cpp/VS_Snippets_Remoting/WebRequest_PreAuthenticate/CPP/webrequest_preauthenticate.cpp deleted file mode 100644 index 1776e52a3d1..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/WebRequest_PreAuthenticate/CPP/webrequest_preauthenticate.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* -System::Net::WebRequest::PreAuthenticate, System::Net::WebRequest::Credentials -This program demonstrates the 'PreAuthenticate' and 'NetworkCredential' properties of the WebRequest Class. -The PreAuthenticate Property has a default value set to False. -This is set to True and new NetwrokCredential object is created with UserName and Password. -This NetworkCredential Object associated to the WebRequest Object to be able to authenticate the requested Uri -To check the validity of this program, please try with some authenticated sites with appropriate credentials -*/ - -#using - -using namespace System; -using namespace System::IO; -using namespace System::Net; -using namespace System::Text; - -void GetPage( String^ url ) -{ - try - { -// -// - // Create a new webrequest to the mentioned URL. - WebRequest^ myWebRequest = WebRequest::Create( url ); - - // Set 'Preauthenticate' property to true. Credentials will be sent with the request. - myWebRequest->PreAuthenticate = true; - - Console::WriteLine( "\nPlease enter your credentials for the requested Url" ); - Console::WriteLine( "UserName" ); - String^ UserName = Console::ReadLine(); - Console::WriteLine( "Password" ); - String^ Password = Console::ReadLine(); - - // Create a New 'NetworkCredential' object. - NetworkCredential^ networkCredential = gcnew NetworkCredential( UserName,Password ); - - // Associate the 'NetworkCredential' object with the 'WebRequest' object. - myWebRequest->Credentials = networkCredential; - - // Assign the response object of 'WebRequest' to a 'WebResponse' variable. - WebResponse^ myWebResponse = myWebRequest->GetResponse(); -// -// - - // Read the 'Response' into a Stream object and then print to the console. - Stream^ streamResponse = myWebResponse->GetResponseStream(); - StreamReader^ streamRead = gcnew StreamReader( streamResponse ); - array^ readBuff = gcnew array(256); - int count = streamRead->Read( readBuff, 0, 256 ); - Console::WriteLine( "\nThe contents of the Html page of the requested Uri are : " ); - while ( count > 0 ) - { - String^ outputData = gcnew String( readBuff,0,count ); - Console::Write( outputData ); - count = streamRead->Read( readBuff, 0, 256 ); - } - streamResponse->Close(); - streamRead->Close(); - - // Release the HttpWebResponse Resource. - myWebResponse->Close(); - } - catch ( WebException^ e ) - { - Console::WriteLine( "\nWebException is raised. " ); - Console::WriteLine( "\nMessage: {0} ", e->Message ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "\nException is raised. " ); - Console::WriteLine( "\nMessage: {0} ", e->Message ); - } - -} - -int main() -{ - array^ args = Environment::GetCommandLineArgs(); - if ( args->Length < 2 ) - { - Console::WriteLine( "\nPlease type the url which requires authentication as command line parameter" ); - Console::WriteLine( "Example:WebRequest_PreAuthenticate http://www.microsoft.com" ); - } - else - { - GetPage( args[ 1 ] ); - } - - Console::WriteLine( "\nPress any key to continue..." ); - Console::ReadLine(); -} diff --git a/snippets/csharp/System.Net/Authorization/.ctor/ClientCloneBasic.cs b/snippets/csharp/System.Net/Authorization/.ctor/ClientCloneBasic.cs deleted file mode 100644 index 27c8bd1706b..00000000000 --- a/snippets/csharp/System.Net/Authorization/.ctor/ClientCloneBasic.cs +++ /dev/null @@ -1,132 +0,0 @@ -/* This is a client program to test the "CloneBasic" class of IAuthenticationModule_Methods_Props.dll. - * - * To demonstrate the functionality of CloneBasic, Client class has been made which makes - * the webrequest for the protected resource. A site for such a protected resource - (http://gopik/clonebasicsite/WebForm1.aspx), which would use CloneBasic authentication, has been developed. - Pl. see the guidelines.txt file for more information in setting up the site at your environment. While - running this program make sure to refer the 'Authroization_Constructor3.dll' - */ - -using System; -using System.Net; -using System.Text; -using System.IO; -using System.Collections; -using CloneBasicAuthentication; - -namespace CloneBasicAuthenticationClient -{ - - // To test our authentication module, we write a client class. - class Client - { - public static void Main(string[] args) - { - try - { - string url,userName,passwd,domain; - if (args.Length < 4) - { - // Proceed with defaults. - Client.PrintUsage(); - Console.WriteLine("\nTo proceed with defaults values press 'y' ,press any other character to exit:"); - string option = Console.ReadLine(); - if (option == "Y" || option == "y") - { - url = "http://gopik/clonebasicsite/WebForm1.aspx"; - userName = "user1"; - passwd = "passwd1"; - domain = "gopik"; - } - else - { - return; - } - } - else - { - url = args[0]; - userName = args[1]; - passwd = args[2]; - domain = args[3]; - } - Console.WriteLine(); - - CloneBasic authenticationModule = new CloneBasic(); - // Register CloneBasic authentication module with the system. - AuthenticationManager.Register(authenticationModule); - Console.WriteLine("\nSuccessfully registered our custom authentication module \"CloneBasic\" "); - // The AuthenticationManager calls all authentication modules sequentially until one of them responds with; - // an authorization instance. We have to unregister "Basic" here as it almost always returns an authorization; - // thereby defeating our purpose to test CloneBasic. - AuthenticationManager.Unregister("Basic"); - - IEnumerator registeredModules = AuthenticationManager.RegisteredModules; - Console.WriteLine("\r\nThe following authentication modules are now registered with the system"); - while(registeredModules.MoveNext()) - { - Console.WriteLine("\r \n Module : {0}",registeredModules.Current); - IAuthenticationModule currentAuthenticationModule = (IAuthenticationModule)registeredModules.Current; - Console.WriteLine("\t CanPreAuthenticate : {0}",currentAuthenticationModule.CanPreAuthenticate); - } - // Calling Our Test Client. - GetPage(url,userName,passwd,domain); - } - catch(Exception e) - { - Console.WriteLine("\n The following exception was raised : {0}",e.Message); - } - } - public static void PrintUsage() - { - Console.WriteLine("\r\nUsage: Try a site which requires CloneBasic(custom made) authentication as below"); - Console.WriteLine(" ClientCloneBasic URLname username password domainname"); - Console.WriteLine("\nExample:"); - Console.WriteLine("\n ClientCloneBasic http://www.microsoft.com/net/ george george123 microsoft"); - } - public static void GetPage(string url,string username,string passwd,string domain) - { - try - { - HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url); - NetworkCredential credentials = new NetworkCredential(username,passwd,domain); - myHttpWebRequest.Credentials = credentials; - HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse(); - Console.WriteLine("\nRequest for protected resource {0} sent",url); - - Stream receiveStream = myHttpWebResponse.GetResponseStream(); - Encoding encode = System.Text.Encoding.GetEncoding("utf-8"); - StreamReader readStream = new StreamReader( receiveStream, encode ); - Console.WriteLine("\r\nResponse stream received"); - - Char[] read = new Char[256]; - // Read 256 characters at a time. - int count = readStream.Read( read, 0, 256 ); - Console.WriteLine("Contents of the response received follows...\r\n"); - - while (count > 0) - { - // Dump the 256 characters on a string and display the string onto the console. - Console.Write(read); - count = readStream.Read(read, 0, 256); - } - Console.WriteLine(""); - // Release the resources of stream object. - readStream.Close(); - // Release the resources of response object. - myHttpWebResponse.Close(); - } - catch(WebException e) - { - if(e.Response != null) - Console.WriteLine("\r\n Exception Raised. The following error occurred : {0}",((HttpWebResponse)(e.Response)).StatusDescription); - else - Console.WriteLine("\r\n Exception Raised. The following error occurred : {0}",e.Status); - } - catch(Exception e) - { - Console.WriteLine("\n The following exception was raised : {0}",e.Message); - } - } - } -} diff --git a/snippets/csharp/System.Net/CookieCollection/Item/CookiesPage.cs b/snippets/csharp/System.Net/CookieCollection/Item/CookiesPage.cs deleted file mode 100644 index 41f91169d8b..00000000000 --- a/snippets/csharp/System.Net/CookieCollection/Item/CookiesPage.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* -** This program is used as the server for -** the programs demonstrating the use of -** cookies. If the initial request from the -** client has cookies, the server uses these -** cookies to generate a page structured with -** the information provided. Otherwise the -** server sends a page to the client requesting -** some information, this information is used -** to structure the subsequent page that is sent -** to the client alongwith the cookies that need -** to be stored by the client for any subsequent -** communication with the server. -*/ - -using System; -using System.IO; -using System.Text; -using System.Collections.Specialized; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.HtmlControls; -using System.Net; - -public class CookiesPage : Page { - - private HtmlForm myForm; - - private TextBox userNameTextBox; - - private TextBox dateBirthTextBox; - - private TextBox placeBirthTextBox; - - // Associate the event handlers with the events. - public CookiesPage() : base() { - Load += new EventHandler(GenerateCookies); - Error += new EventHandler(UnhandledException); - Init += new EventHandler(PageInit); - } - - // Create the controls for the web page. - private void PageInit(Object Sender, EventArgs e) { - userNameTextBox = new TextBox(); - userNameTextBox.ID = "UserName"; - dateBirthTextBox = new TextBox(); - dateBirthTextBox.ID = "DateOfBirth"; - placeBirthTextBox = new TextBox(); - placeBirthTextBox.ID = "PlaceOfBirth"; - placeBirthTextBox.AutoPostBack = true; - myForm = new HtmlForm(); - myForm.Method = "POST"; - } - - private void UnhandledException(Object Sender, EventArgs e) { - Response.Write("There was an unhandled exception on this page"); - } - - private void GenerateCookies(Object Sender, EventArgs e) { - bool noCookieHeader = false; - if(Request.Cookies["UserName"] == null) - noCookieHeader = true; - - // If there is no cookies in the request then send a web page querying info. - if(noCookieHeader) { - // Compose a page with the info sent from the client as a post back. - if(IsPostBack) { - RemoveControls(); - HttpCookie myHttpCookie = new HttpCookie("UserName", Request.Form["UserName"]); - myHttpCookie.Domain = Request.Url.Host; - myHttpCookie.Path = Request.Path; - myHttpCookie.Expires = DateTime.Now.AddHours(-12); - myHttpCookie.Secure = false; - Response.Cookies.Add(myHttpCookie); - myHttpCookie = new HttpCookie("DateOfBirth", Request.Form["DateOfBirth"]); - myHttpCookie.Domain = Request.Url.Host; - myHttpCookie.Path = Request.Path; - myHttpCookie.Expires = DateTime.Now.AddHours(-12); - myHttpCookie.Secure = false; - Response.Cookies.Add(myHttpCookie); - myHttpCookie = new HttpCookie("PlaceOfBirth", Request.Form["PlaceOfBirth"]); - myHttpCookie.Domain = Request.Url.Host; - myHttpCookie.Path = Request.Path; - myHttpCookie.Expires = DateTime.Now.AddHours(-12); - myHttpCookie.Secure = false; - Response.Cookies.Add(myHttpCookie); - Response.Write(Request.Form["UserName"] + - " , was born on " + - Request.Form["DateOfBirth"] + - " at " + - Request.Form["PlaceOfBirth"]); - } - // Request information from the client. - else - { - AddControls(); - Response.Write("Please enter the values : "); - } - } - // Compose a page with the information in the cookies sent over. - else { - Response.Write(Request.Cookies["UserName"].Value + - " , was born on " + - Request.Cookies["DateOfBirth"].Value + - " at " + - Request.Cookies["PlaceOfBirth"].Value); - } - } - - protected void AddControls() { - Controls.Add(myForm); - myForm.Controls.Add(userNameTextBox); - myForm.Controls.Add(dateBirthTextBox); - myForm.Controls.Add(placeBirthTextBox); - } - - protected void RemoveControls() { - Controls.Remove(myForm); - myForm.Controls.Remove(userNameTextBox); - myForm.Controls.Remove(dateBirthTextBox); - myForm.Controls.Remove(placeBirthTextBox); - } -}; diff --git a/snippets/csharp/System.Net/CookieCollection/Item/CookiesPage1.cs b/snippets/csharp/System.Net/CookieCollection/Item/CookiesPage1.cs deleted file mode 100644 index 41f91169d8b..00000000000 --- a/snippets/csharp/System.Net/CookieCollection/Item/CookiesPage1.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* -** This program is used as the server for -** the programs demonstrating the use of -** cookies. If the initial request from the -** client has cookies, the server uses these -** cookies to generate a page structured with -** the information provided. Otherwise the -** server sends a page to the client requesting -** some information, this information is used -** to structure the subsequent page that is sent -** to the client alongwith the cookies that need -** to be stored by the client for any subsequent -** communication with the server. -*/ - -using System; -using System.IO; -using System.Text; -using System.Collections.Specialized; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.HtmlControls; -using System.Net; - -public class CookiesPage : Page { - - private HtmlForm myForm; - - private TextBox userNameTextBox; - - private TextBox dateBirthTextBox; - - private TextBox placeBirthTextBox; - - // Associate the event handlers with the events. - public CookiesPage() : base() { - Load += new EventHandler(GenerateCookies); - Error += new EventHandler(UnhandledException); - Init += new EventHandler(PageInit); - } - - // Create the controls for the web page. - private void PageInit(Object Sender, EventArgs e) { - userNameTextBox = new TextBox(); - userNameTextBox.ID = "UserName"; - dateBirthTextBox = new TextBox(); - dateBirthTextBox.ID = "DateOfBirth"; - placeBirthTextBox = new TextBox(); - placeBirthTextBox.ID = "PlaceOfBirth"; - placeBirthTextBox.AutoPostBack = true; - myForm = new HtmlForm(); - myForm.Method = "POST"; - } - - private void UnhandledException(Object Sender, EventArgs e) { - Response.Write("There was an unhandled exception on this page"); - } - - private void GenerateCookies(Object Sender, EventArgs e) { - bool noCookieHeader = false; - if(Request.Cookies["UserName"] == null) - noCookieHeader = true; - - // If there is no cookies in the request then send a web page querying info. - if(noCookieHeader) { - // Compose a page with the info sent from the client as a post back. - if(IsPostBack) { - RemoveControls(); - HttpCookie myHttpCookie = new HttpCookie("UserName", Request.Form["UserName"]); - myHttpCookie.Domain = Request.Url.Host; - myHttpCookie.Path = Request.Path; - myHttpCookie.Expires = DateTime.Now.AddHours(-12); - myHttpCookie.Secure = false; - Response.Cookies.Add(myHttpCookie); - myHttpCookie = new HttpCookie("DateOfBirth", Request.Form["DateOfBirth"]); - myHttpCookie.Domain = Request.Url.Host; - myHttpCookie.Path = Request.Path; - myHttpCookie.Expires = DateTime.Now.AddHours(-12); - myHttpCookie.Secure = false; - Response.Cookies.Add(myHttpCookie); - myHttpCookie = new HttpCookie("PlaceOfBirth", Request.Form["PlaceOfBirth"]); - myHttpCookie.Domain = Request.Url.Host; - myHttpCookie.Path = Request.Path; - myHttpCookie.Expires = DateTime.Now.AddHours(-12); - myHttpCookie.Secure = false; - Response.Cookies.Add(myHttpCookie); - Response.Write(Request.Form["UserName"] + - " , was born on " + - Request.Form["DateOfBirth"] + - " at " + - Request.Form["PlaceOfBirth"]); - } - // Request information from the client. - else - { - AddControls(); - Response.Write("Please enter the values : "); - } - } - // Compose a page with the information in the cookies sent over. - else { - Response.Write(Request.Cookies["UserName"].Value + - " , was born on " + - Request.Cookies["DateOfBirth"].Value + - " at " + - Request.Cookies["PlaceOfBirth"].Value); - } - } - - protected void AddControls() { - Controls.Add(myForm); - myForm.Controls.Add(userNameTextBox); - myForm.Controls.Add(dateBirthTextBox); - myForm.Controls.Add(placeBirthTextBox); - } - - protected void RemoveControls() { - Controls.Remove(myForm); - myForm.Controls.Remove(userNameTextBox); - myForm.Controls.Remove(dateBirthTextBox); - myForm.Controls.Remove(placeBirthTextBox); - } -}; diff --git a/snippets/csharp/System.Net/HttpWebRequest/ConnectionGroupName/source.cs b/snippets/csharp/System.Net/HttpWebRequest/ConnectionGroupName/source.cs deleted file mode 100644 index 4d0ed4f5340..00000000000 --- a/snippets/csharp/System.Net/HttpWebRequest/ConnectionGroupName/source.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Net; -using System.Web; -using System.Web.UI; -using System.Security.Cryptography; -using System.Text; - -public class TestClass: Page -{ - - public static int Main(String[] args) - { -// - // Create a secure group name. - // This example uses the SHA1 algorithm. - // Due to collision problems with SHA1, Microsoft recommends SHA256 or better. - SHA1Managed Sha1 = new SHA1Managed(); - Byte[] updHash = Sha1.ComputeHash(Encoding.UTF8.GetBytes("username" + "password" + "domain")); - String secureGroupName = Encoding.Default.GetString(updHash); - - // Create a request for a specific URL. - WebRequest myWebRequest=WebRequest.Create("http://www.contoso.com"); - - // Set the authentication credentials for the request. - myWebRequest.Credentials = new NetworkCredential("username", "password", "domain"); - myWebRequest.ConnectionGroupName = secureGroupName; - - // Get the response. - WebResponse myWebResponse=myWebRequest.GetResponse(); - - // Insert the code that uses myWebResponse here. - - // Close the response. - myWebResponse.Close(); - -// - - return 0; - } -} diff --git a/snippets/csharp/System.Net/SocketPermission/.ctor/DateServer_SocketPermission.cs b/snippets/csharp/System.Net/SocketPermission/.ctor/DateServer_SocketPermission.cs deleted file mode 100644 index fc6a7cb7995..00000000000 --- a/snippets/csharp/System.Net/SocketPermission/.ctor/DateServer_SocketPermission.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* - This program demonstrates the 'AcceptList' property of 'SocketPermission' class. - - This program provides a class called 'DateServer' that functions as a server - for a 'DateClient'. A 'DateServer' is a server that provides the current date on - the server in response to a request from a client. The 'DateServer' class - provides a method called 'Create' which waits for client connections and sends - the current date on that socket connection. Within the 'Create' method of - 'DateServer' class an instance of 'SocketPermission' is created with the - 'SocketPermission(NetworkAccess, TransportType, string, int)' constructor. - If the calling method has the requisite permissions the 'Create' method waits - for client connections and sends the current date on the socket connection. - -*/ - -using System; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Security; -using System.Collections; - -public class DateServer { - - // Client connecting to the date server. - private Socket clientSocket; - private Socket serverSocket; - private Encoding asciiEncoding; - - public readonly int serverBacklog; - - public static void Main(String[] args) { - if(args.Length != 1) - { - PrintUsage(); - return; - } - DateServer server = new DateServer(); - try { - server.Create(args[0]); - } - catch(SecurityException securityException) { - Console.WriteLine("SecurityException caught !!!"); - Console.WriteLine("Message : " + securityException.Message); - } - catch(Exception exception) { - Console.WriteLine("Exception caught !!!"); - Console.WriteLine("Message " + exception.Message); - } - } - - public DateServer() { - asciiEncoding = Encoding.ASCII; - serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); - serverBacklog = 10; - } - - // Return the current date on the client connection. - public bool Create(String portString) { - // Create another 'SocketPermission' object with two ip addresses. - // First 'SocketPermission' ip-address is '192.168.144.238' for 'All' transport types and - // for 'All' ports for the ip-address. - SocketPermission socketPermission = - new SocketPermission(NetworkAccess.Accept, - TransportType.All, - "192.168.144.238", - SocketPermission.AllPorts); - - // Second 'SocketPermission' ip-address is '192.168.144.239' for 'All' transport types and - // for 'All' ports for the ip-address. - socketPermission.AddPermission(NetworkAccess.Accept, - TransportType.All, - "192.168.144.239", - SocketPermission.AllPorts); - - Console.WriteLine("Display result of AcceptList property : "); - IEnumerator enumerator = socketPermission.AcceptList; - while(enumerator.MoveNext()) { - Console.WriteLine("The hostname is : {0}", ((EndpointPermission)enumerator.Current).Hostname); - Console.WriteLine("The port is : {0}", ((EndpointPermission)enumerator.Current).Port); - Console.WriteLine("The Transport type is : {0}", ((EndpointPermission)enumerator.Current).Transport); - } - - // Demand for the calling method for requisite socket permissions. - socketPermission.Demand(); - serverSocket.Bind(new IPEndPoint((Dns.Resolve(Dns.GetHostName()).AddressList)[0], Int16.Parse(portString))); - serverSocket.Listen(serverBacklog); - while(true) { - try { - clientSocket = serverSocket.Accept(); - byte[] sendByte = asciiEncoding.GetBytes(DateTime.Now.ToString()); - clientSocket.Send(sendByte, sendByte.Length, 0); - clientSocket.Close(); - } - catch(Exception e) { - Console.WriteLine("\nException raised : {0}", e.Message); - return false; - } - } - } - - public static void PrintUsage() { - Console.WriteLine("Usage : DateServer_SocketPermission"); - Console.WriteLine("\tDateServer_SocketPermission "); - Console.WriteLine("\tport is the port on which the DateServer is listening"); - } -}; diff --git a/snippets/csharp/System.Net/SocketPermission/ConnectList/DateServer_SocketPermission.cs b/snippets/csharp/System.Net/SocketPermission/ConnectList/DateServer_SocketPermission.cs deleted file mode 100644 index fc6a7cb7995..00000000000 --- a/snippets/csharp/System.Net/SocketPermission/ConnectList/DateServer_SocketPermission.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* - This program demonstrates the 'AcceptList' property of 'SocketPermission' class. - - This program provides a class called 'DateServer' that functions as a server - for a 'DateClient'. A 'DateServer' is a server that provides the current date on - the server in response to a request from a client. The 'DateServer' class - provides a method called 'Create' which waits for client connections and sends - the current date on that socket connection. Within the 'Create' method of - 'DateServer' class an instance of 'SocketPermission' is created with the - 'SocketPermission(NetworkAccess, TransportType, string, int)' constructor. - If the calling method has the requisite permissions the 'Create' method waits - for client connections and sends the current date on the socket connection. - -*/ - -using System; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Security; -using System.Collections; - -public class DateServer { - - // Client connecting to the date server. - private Socket clientSocket; - private Socket serverSocket; - private Encoding asciiEncoding; - - public readonly int serverBacklog; - - public static void Main(String[] args) { - if(args.Length != 1) - { - PrintUsage(); - return; - } - DateServer server = new DateServer(); - try { - server.Create(args[0]); - } - catch(SecurityException securityException) { - Console.WriteLine("SecurityException caught !!!"); - Console.WriteLine("Message : " + securityException.Message); - } - catch(Exception exception) { - Console.WriteLine("Exception caught !!!"); - Console.WriteLine("Message " + exception.Message); - } - } - - public DateServer() { - asciiEncoding = Encoding.ASCII; - serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); - serverBacklog = 10; - } - - // Return the current date on the client connection. - public bool Create(String portString) { - // Create another 'SocketPermission' object with two ip addresses. - // First 'SocketPermission' ip-address is '192.168.144.238' for 'All' transport types and - // for 'All' ports for the ip-address. - SocketPermission socketPermission = - new SocketPermission(NetworkAccess.Accept, - TransportType.All, - "192.168.144.238", - SocketPermission.AllPorts); - - // Second 'SocketPermission' ip-address is '192.168.144.239' for 'All' transport types and - // for 'All' ports for the ip-address. - socketPermission.AddPermission(NetworkAccess.Accept, - TransportType.All, - "192.168.144.239", - SocketPermission.AllPorts); - - Console.WriteLine("Display result of AcceptList property : "); - IEnumerator enumerator = socketPermission.AcceptList; - while(enumerator.MoveNext()) { - Console.WriteLine("The hostname is : {0}", ((EndpointPermission)enumerator.Current).Hostname); - Console.WriteLine("The port is : {0}", ((EndpointPermission)enumerator.Current).Port); - Console.WriteLine("The Transport type is : {0}", ((EndpointPermission)enumerator.Current).Transport); - } - - // Demand for the calling method for requisite socket permissions. - socketPermission.Demand(); - serverSocket.Bind(new IPEndPoint((Dns.Resolve(Dns.GetHostName()).AddressList)[0], Int16.Parse(portString))); - serverSocket.Listen(serverBacklog); - while(true) { - try { - clientSocket = serverSocket.Accept(); - byte[] sendByte = asciiEncoding.GetBytes(DateTime.Now.ToString()); - clientSocket.Send(sendByte, sendByte.Length, 0); - clientSocket.Close(); - } - catch(Exception e) { - Console.WriteLine("\nException raised : {0}", e.Message); - return false; - } - } - } - - public static void PrintUsage() { - Console.WriteLine("Usage : DateServer_SocketPermission"); - Console.WriteLine("\tDateServer_SocketPermission "); - Console.WriteLine("\tport is the port on which the DateServer is listening"); - } -}; diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/activitylibrary1.vbproj b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/activitylibrary1.vbproj deleted file mode 100644 index 693e4dd9312..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/activitylibrary1.vbproj +++ /dev/null @@ -1,114 +0,0 @@ - - - - Debug - AnyCPU - 10.0 - 2.0 - {89B782D9-0C7D-45A3-AAA6-C28571BC2E8F} - {32f31d43-81cc-4c15-9de6-3fc5453562b6};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} - Library - ActivityLibrary1 - ActivityLibrary1 - 512 - Windows - v4.8 - - On - Binary - Off - On - - - true - full - true - true - bin\Debug\ - ActivityLibrary1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - pdbonly - false - true - true - bin\Release\ - ActivityLibrary1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ReadInt.vb - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - MSBuild:Compile - Designer - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/application.designer.vb b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/application.designer.vb deleted file mode 100644 index 40fce7c2266..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/application.designer.vb +++ /dev/null @@ -1,13 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.1433 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/application.myapp b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/application.myapp deleted file mode 100644 index 758895def25..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/application.myapp +++ /dev/null @@ -1,10 +0,0 @@ - - - false - false - 0 - true - 0 - 1 - true - diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/assemblyinfo.vb b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/assemblyinfo.vb deleted file mode 100644 index 2e29e652984..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/assemblyinfo.vb +++ /dev/null @@ -1,34 +0,0 @@ -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/resources.designer.vb b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/resources.designer.vb deleted file mode 100644 index 832e87d3e0a..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/resources.designer.vb +++ /dev/null @@ -1,62 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.1433 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My.Resources - - 'This class was auto-generated by the StronglyTypedResourceBuilder - 'class via a tool like ResGen or Visual Studio. - 'To add or remove a member, edit your .ResX file then rerun ResGen - 'with the /str option, or rebuild your VS project. - ' - ' A strongly-typed resource class, for looking up localized strings, etc. - ' - _ - Friend Module Resources - - Private resourceMan As Global.System.Resources.ResourceManager - - Private resourceCulture As Global.System.Globalization.CultureInfo - - ' - ' Returns the cached ResourceManager instance used by this class. - ' - _ - Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager - Get - If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ActivityLibrary1.Resources", GetType(Resources).Assembly) - resourceMan = temp - End If - Return resourceMan - End Get - End Property - - ' - ' Overrides the current thread's CurrentUICulture property for all - ' resource lookups using this strongly typed resource class. - ' - _ - Friend Property Culture() As Global.System.Globalization.CultureInfo - Get - Return resourceCulture - End Get - Set(ByVal value As Global.System.Globalization.CultureInfo) - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/resources.resx b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/resources.resx deleted file mode 100644 index af7dbebbace..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/settings.designer.vb b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/settings.designer.vb deleted file mode 100644 index feaf7c16f09..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/settings.designer.vb +++ /dev/null @@ -1,73 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.1433 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My - - _ - Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) - -#Region "My.Settings Auto-Save Functionality" -#If _MyType = "WindowsForms" Then - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub -#End If -#End Region - - Public Shared ReadOnly Property [Default]() As MySettings - Get - -#If _MyType = "WindowsForms" Then - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If -#End If - Return defaultInstance - End Get - End Property - End Class -End Namespace - -Namespace My - - _ - Friend Module MySettingsProperty - - _ - Friend ReadOnly Property Settings() As Global.ActivityLibrary1.My.MySettings - Get - Return Global.ActivityLibrary1.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/settings.settings b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/settings.settings deleted file mode 100644 index 85b890b3c66..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/my project/settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/prompt.xaml b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/prompt.xaml deleted file mode 100644 index 6638c0e6aeb..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/activitylibrary1/prompt.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - 273,287 - Assembly references and imported namespaces for internal implementation - - - - True - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/app.config b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/app.config deleted file mode 100644 index 682adf1628b..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/app.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/application.designer.vb b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/application.designer.vb deleted file mode 100644 index 40fce7c2266..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/application.designer.vb +++ /dev/null @@ -1,13 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.1433 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/application.myapp b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/application.myapp deleted file mode 100644 index e62f1a53381..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/application.myapp +++ /dev/null @@ -1,10 +0,0 @@ - - - false - false - 0 - true - 0 - 2 - true - diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/assemblyinfo.vb b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/assemblyinfo.vb deleted file mode 100644 index f7e98668996..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/assemblyinfo.vb +++ /dev/null @@ -1,34 +0,0 @@ -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/resources.designer.vb b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/resources.designer.vb deleted file mode 100644 index da0314f7b9b..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/resources.designer.vb +++ /dev/null @@ -1,62 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.1433 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My.Resources - - 'This class was auto-generated by the StronglyTypedResourceBuilder - 'class via a tool like ResGen or Visual Studio. - 'To add or remove a member, edit your .ResX file then rerun ResGen - 'with the /str option, or rebuild your VS project. - ' - ' A strongly-typed resource class, for looking up localized strings, etc. - ' - _ - Friend Module Resources - - Private resourceMan As Global.System.Resources.ResourceManager - - Private resourceCulture As Global.System.Globalization.CultureInfo - - ' - ' Returns the cached ResourceManager instance used by this class. - ' - _ - Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager - Get - If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WorkflowConsoleApplication1.Resources", GetType(Resources).Assembly) - resourceMan = temp - End If - Return resourceMan - End Get - End Property - - ' - ' Overrides the current thread's CurrentUICulture property for all - ' resource lookups using this strongly typed resource class. - ' - _ - Friend Property Culture() As Global.System.Globalization.CultureInfo - Get - Return resourceCulture - End Get - Set(ByVal value As Global.System.Globalization.CultureInfo) - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/resources.resx b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/resources.resx deleted file mode 100644 index af7dbebbace..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/settings.designer.vb b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/settings.designer.vb deleted file mode 100644 index a0baaccef63..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/settings.designer.vb +++ /dev/null @@ -1,73 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.1433 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My - - _ - Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) - -#Region "My.Settings Auto-Save Functionality" -#If _MyType = "WindowsForms" Then - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub -#End If -#End Region - - Public Shared ReadOnly Property [Default]() As MySettings - Get - -#If _MyType = "WindowsForms" Then - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If -#End If - Return defaultInstance - End Get - End Property - End Class -End Namespace - -Namespace My - - _ - Friend Module MySettingsProperty - - _ - Friend ReadOnly Property Settings() As Global.WorkflowConsoleApplication1.My.MySettings - Get - Return Global.WorkflowConsoleApplication1.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/settings.settings b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/settings.settings deleted file mode 100644 index 85b890b3c66..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/my project/settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/snippets.5000.json b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/snippets.5000.json deleted file mode 100644 index 9493e733615..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/snippets.5000.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "host": "visualstudio" -} \ No newline at end of file diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/workflow1.xaml b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/workflow1.xaml deleted file mode 100644 index 07d51bcd641..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/workflow1.xaml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - 654,676 - Assembly references and imported namespaces for internal implementation - - - - - - - - False - 270,2.5 - 60,75 - 300,77.5 300,91 - - - - __ReferenceID6 - - - - - 179,91 - 242,58 - 300,149 300,159 - - - - - [Target] - - - [New System.Random().Next(1, MaxNumber + 1)] - - - - - - - 200,159 - 200,22 - 300,181 300,191 - - - - - - - - 179,191 - 242,58 - 300,249 300,262.5 - - - - - [Turns] - - - [Turns + 1] - - - - - - - 270,262.5 - 60,75 - 330,300 360,300 360,342.5 - - - - - - - 330,342.5 - 60,75 - 330,380 205.5,380 205.5,449 - 390,380 430,380 430,439.5 - - - - - - - 100,449 - 211,61 - 100,479.5 70,479.5 70,170 200,170 - - - - - __ReferenceID0 - - - - - - - - 324.5,439.5 - 211,61 - 535.5,470 565.5,470 565.5,170 400,170 - - - - - __ReferenceID0 - - - - - - - - - - - - - __ReferenceID0 - __ReferenceID1 - __ReferenceID2 - __ReferenceID3 - __ReferenceID4 - __ReferenceID5 - - \ No newline at end of file diff --git a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/workflowconsoleapplication1.vbproj b/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/workflowconsoleapplication1.vbproj deleted file mode 100644 index b522eda9743..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/workflowconsoleapplication1/workflowconsoleapplication1.vbproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - Debug - x86 - 10.0 - 2.0 - {96BB87E6-9679-4FF8-A278-DB6CB3F1A093} - {32f31d43-81cc-4c15-9de6-3fc5453562b6};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} - Exe - Sub Main - WorkflowConsoleApplication1 - WorkflowConsoleApplication1 - 512 - Console - v4.8 - - On - Binary - Off - On - - - x86 - true - full - true - true - bin\Debug\ - WorkflowConsoleApplication1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - x86 - pdbonly - false - true - true - bin\Release\ - WorkflowConsoleApplication1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - - - - - - - - - - - - - - - - - - - - - - - - - Module1.vb - - - ExtraSnippets.vb - - - - True - Application.myapp - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - - Designer - MSBuild:Compile - - - - - {89B782D9-0C7D-45A3-AAA6-C28571BC2E8F} - ActivityLibrary1 - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/VS_Snippets_CFX/poxsample/vb/server/customer.vb b/snippets/visualbasic/VS_Snippets_CFX/poxsample/vb/server/customer.vb deleted file mode 100644 index 1c755e0407e..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/poxsample/vb/server/customer.vb +++ /dev/null @@ -1,13 +0,0 @@ -Imports System.Collections.Generic -Imports System.Text -Imports System.Runtime.Serialization - -Namespace Microsoft.ServiceModel.Samples - _ - Public Class Customer - _ - Public Name As String - _ - Public Address As String - End Class -End Namespace \ No newline at end of file diff --git a/snippets/visualbasic/VS_Snippets_CFX/poxsample/vb/server/iuniversalcontract.vb b/snippets/visualbasic/VS_Snippets_CFX/poxsample/vb/server/iuniversalcontract.vb deleted file mode 100644 index d49e2df00dd..00000000000 --- a/snippets/visualbasic/VS_Snippets_CFX/poxsample/vb/server/iuniversalcontract.vb +++ /dev/null @@ -1,12 +0,0 @@ -Imports System.ServiceModel.Channels -Imports System.Collections.Generic -Imports System.Text -Imports System.ServiceModel - -Namespace Microsoft.ServiceModel.Samples - _ - Public Interface IUniversalContract - _ - Function ProcessMessage(ByVal input As Message) As Message - End Interface -End Namespace diff --git a/snippets/visualbasic/VS_Snippets_Remoting/Classic HttpWebRequest.ConnectionGroupName Example/VB/source.vb b/snippets/visualbasic/VS_Snippets_Remoting/Classic HttpWebRequest.ConnectionGroupName Example/VB/source.vb deleted file mode 100644 index 8178fd0bf6f..00000000000 --- a/snippets/visualbasic/VS_Snippets_Remoting/Classic HttpWebRequest.ConnectionGroupName Example/VB/source.vb +++ /dev/null @@ -1,43 +0,0 @@ -Imports System.Net -Imports System.Web -Imports System.Web.UI -Imports System.Security.Cryptography -Imports System.Text - - -Public Class TestClass - Inherits Page - - 'Entry point which delegates to C-style main Private Function - Public Overloads Shared Sub Main() - System.Environment.ExitCode = Main(System.Environment.GetCommandLineArgs()) - End Sub - - - Overloads Public Shared Function Main(args() As [String]) As Integer -' - ' Create a secure group name. - ' This example uses the SHA1 algorithm. - ' Due to collision problems with SHA1, Microsoft recommends SHA256 or better. - Dim Sha1 As New SHA1Managed() - Dim updHash As [Byte]() = Sha1.ComputeHash(Encoding.UTF8.GetBytes(("username" + "password" + "domain"))) - Dim secureGroupName As [String] = Encoding.Default.GetString(updHash) - - ' Create a request for a specific URL. - Dim myWebRequest As WebRequest = WebRequest.Create("http://www.contoso.com") - - ' Set the authentication credentials for the request. - myWebRequest.Credentials = New NetworkCredential("username", "password", "domain") - myWebRequest.ConnectionGroupName = secureGroupName - - ' Get the response. - Dim myWebResponse As WebResponse = myWebRequest.GetResponse() - - ' Insert the code that uses myWebResponse here. - ' Close the response. - myWebResponse.Close() - -' - Return 0 - End Function 'Main -End Class \ No newline at end of file diff --git a/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_PreAuthenticate/VB/webrequest_preauthenticate.vb b/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_PreAuthenticate/VB/webrequest_preauthenticate.vb deleted file mode 100644 index f2df1cafcaf..00000000000 --- a/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_PreAuthenticate/VB/webrequest_preauthenticate.vb +++ /dev/null @@ -1,84 +0,0 @@ -'System.Net.WebRequest.PreAuthenticate,System.Net.WebRequest.Credentials -'This program demonstrates the 'PreAuthenticate' and 'Credentials' properties of the WebRequest Class. -'The PreAuthenticate Property has a default value set to False. -'This is set to True and new NetwrokCredential object is created with UserName and Password. -'This NetworkCredential Object associated to the WebRequest Object to be able to authenticate the requested Uri -'To check the validity of this program, please try with some authenticated sites with appropriate credentials - -Imports System.IO -Imports System.Net -Imports System.Text -Imports System.Environment - -Class WebRequest_Preauthenticate - Public Overloads Shared Sub Main() - Main(GetCommandLineArgs()) - End Sub - - Overloads Shared Sub Main(args() As String) - If args.Length < 2 Then - Console.WriteLine(ControlChars.Cr + "Please type the url which requires authentication as command line parameter") - Console.WriteLine("Example:WebRequest_PreAuthenticate http://www.microsoft.com") - Else - GetPage(args(1)) - End If - Console.WriteLine(ControlChars.Cr + "Press any key to continue...") - Console.ReadLine() - Return - End Sub - - Public Shared Sub GetPage(url As String) - Try -' -' - - ' Create a new webrequest to the mentioned URL. - Dim myWebRequest As WebRequest = WebRequest.Create(url) - - ' Set 'Preauthenticate' property to true. - myWebRequest.PreAuthenticate = True - Console.WriteLine(ControlChars.Cr + "Please enter your credentials for the requested Url") - Console.WriteLine("UserName") - Dim UserName As String = Console.ReadLine() - Console.WriteLine("Password") - Dim Password As String = Console.ReadLine() - - ' Create a New 'NetworkCredential' object. - Dim networkCredential As New NetworkCredential(UserName, Password) - - ' Associate the 'NetworkCredential' object with the 'WebRequest' object. - myWebRequest.Credentials = networkCredential - - ' Assign the response object of 'WebRequest' to a 'WebResponse' variable. - Dim myWebResponse As WebResponse = myWebRequest.GetResponse() - -' -' - ' Read the 'Response' into a Stream object and then print to the console. - Dim streamResponse As Stream = myWebResponse.GetResponseStream() - Dim streamRead As New StreamReader(streamResponse) - Dim readBuff(256) As [Char] - Dim count As Integer = streamRead.Read(readBuff, 0, 256) - Console.WriteLine(ControlChars.Cr + "The contents of the Html page of the requested Uri are : ") - While count > 0 - Dim outputData As New [String](readBuff, 0, count) - Console.Write(outputData) - count = streamRead.Read(readBuff, 0, 256) - End While - ' Close the Stream object. - streamResponse.Close() - streamRead.Close() - ' Release the HttpWebResponse Resource. - myWebResponse.Close() - Catch e As WebException - Console.WriteLine(ControlChars.Cr + "WebException is raised. ") - Console.WriteLine(ControlChars.Cr + "Message:{0} ", e.Message) - Catch e As Exception - Console.WriteLine(ControlChars.Cr + "Exception is raised. ") - Console.WriteLine(ControlChars.Cr + "Message:{0} ", e.Message) - End Try - End Sub -End Class - - -