What do you want to save?
Add Code snippet
New code examples
-
C# 2021-10-01 07:59:02
encrypt with public key and decrypt with private key c#
private static string _privateKey; private static string _publicKey; private static UnicodeEncoding _encoder = new UnicodeEncoding(); private static void RSA() { var rsa = new RSACryptoServiceProvider(); _privateKey = rsa.ToXmlString(true); _public... Add solution -
Java 2021-09-28 20:29:05
generta epassword java
import java.util.Random; public class PasswordGenerator { public static String generateRandomPassword(int len) { String chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi" +"jklmnopqrstuvwxyz!@#$%&"; Random rnd ... Add solution -
C# 2021-09-26 11:24:01
c# networkstream read all bytes
// Examples for CanRead, Read, and DataAvailable. // Check to see if this NetworkStream is readable. if(myNetworkStream.CanRead) { byte[] myReadBuffer = new byte[1024]; StringBuilder myCompleteMessage = new StringBuilder(); int numberOfBytes... Add solution -
Other 2021-09-26 03:38:04
Display all members of class using a for loop vb.net
Public Class [MyClass] Private a As String Private b As String Public Sub New(a As String, b As String) Me.a = a Me.b = b End Sub Public Overrides Function ToString() As String Dim sb = New StringBuilder() ... Add solution -
TypeScript 2021-09-23 03:56:03
c# ienumerable wrap to know when its compltee
IEnumerable<string> names = GetNames(); foreach (var name in names) Console.WriteLine("Found " + name); var allNames = new StringBuilder(); foreach (var name in names) allNames.Append(name + " "); Add solution -
C# 2021-09-21 21:22:04
c# create log file
From the performance point of view your solution is not optimal. Every time you add another log entry with +=, the whole string is copied to another place in memory. I would recommend using StringBuilder instead: StringBuilder sb = new StringBuilder(); .... Add solution