C# - Convert a PDF File to Base64String
C# Convert a PDF File to Base64String Create a Windows Forms Project Name it “ConvertFileToBase64” Open Form1.cs and add a Label, two textboxes and a button Double click on the button and add the following code: string userPath; userPath = Environment .GetFolderPath( Environment . SpecialFolder .UserProfile) + "\\Desktop" ; OpenFileDialog ofd = new OpenFileDialog (); ofd.InitialDirectory = userPath; ofd.Filter = "html files (*.html)|*.txt|All files (*.*)|*.*" ; ofd.FilterIndex = 2; ofd.RestoreDirectory = true ; ofd.ShowDialog(); string fName = ofd.FileName; textBox1.Text = ...