To get the path of the active app.config file in C# and VB.NET you can use the following snippet
Sample C#
AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
Sample VB.NET
AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
To get the path of the active app.config file in C# and VB.NET you can use the following snippet
AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
To read a file to string in Java you can use the following snippet.
public static string readFileToString(FileInputStream _fileInputStream) { try { DataInputStream dataInputStream = new DataInputStream (_fileInputStream); byte[] Bytes = new byte[dataInputStream.available ()]; dataInputStream.readFully (Bytes); dataInputStream.close (); String result = new String (Bytes, 0, Bytes.length, "Cp850"); return result; } catch (Exception e) { e.printStackTrace(); return ""; } }
To scroll to the end of a Textbox in C# and VB.NET you can use the following snippet.
textBox1.SelectionStart = textBox1.Text.Length; textBox1.ScrollToCaret();
To encode and decode Base64 in PHP you can use the following snippet.
function EncodeBase64($input) { return base64_encode($input); } function DecodeBase64($input) { return base64_decode($input); }
To make input numeric only in jQuery you can use the following snippet.
$('input.numbersOnlyinput').bind('keypress', function(input) { return (input.which === 0 || input.which === 8 || (input.shiftKey === false && (input.which < 58 && input.which > 47))) ? true : false; }