Copy the WebBrowser Control’s Text into Windows Clipboard
The WebBrowser control’s document object gives us the ExecCommand method that takes in dom commands such as ‘SelectAll’, and ‘Copy’ which can copy the text for you. You need to
The WebBrowser control’s document object gives us the ExecCommand method that takes in dom commands such as ‘SelectAll’, and ‘Copy’ which can copy the text for you. You need to
Use this function to break the data links in an Excel workbook. It shows a message asking the user to confirm to break. private void BreakDataLinks(Excel._Workbook wb){ if (DialogResult.Yes ==
The SQLCommandBuilder has the helpful DeriveParameters command that gives you the list of parameters of a stored procedure. All you have to do is: Set the commandText of the command
The Command Window (Ctrl+Alt+A) in the VS.NET IDE has many more features than it appears to have. It is mainly used as the interactive debug window but also you can
var configFilePath = @”C:CodeClassifiedConfigurationsapp.config”;var sectionName = “appSettings”;EncryptConfigSection(configFilePath, sectionName);private void EncryptConfigSection(string configFilePath, string sectionName){ var configurationFileMap = new ExeConfigurationFileMap { ExeConfigFilename = configFilePath }; var configuration = ConfigurationManager.OpenMappedExeConfiguration(configurationFileMap, ConfigurationUserLevel.None); var configSection
You can encrypt your connection string to a database. Let me rephrase that: you should encrypt data connections. Here is an example of encrypting a connection string and decryprting a
Use the CamelCasePropertyNamesContractResolver class of the Newtonsoft.Json assembly to return the JSON serialized string in camel case. var responseObject = employeeProxy.GetAllEmployees();var serializedObjectInCamelCase = JsonConvert.SerializeObject(responseObject, new JsonSerializerSettings { ContractResolver = new
A quick way is to use a picturebox and set an animated gif to it. We can make use of the Navigating and Navigated events to show/hide the picturebox as
We can use the SecurityElement’s Escape method of the System.Security namespace to escape all the special characters in an XML file. Code snippet below: string escapedstring = System.Security.SecurityElement.Escape(inputXMLString); …inputXMLString ?contains