Hey all I have the following VB.net code that I need converted to C#:
Dim tClient As WebClient = New WebClient Dim imgLink As String = "\\the\path\photos\" + userID + ".jpg" Dim tImage As Bitmap = Bitmap.FromStream(New MemoryStream(tClient.DownloadData(imgLink))) Dim mImage As String = ImageToBase64(tImage, System.Drawing.Imaging.ImageFormat.Jpeg) That works just fine in VB but when I try to convert it to C#:
WebClient tClient = new WebClient(); string mImage = @"\\the\path\photos\" + userID + ".jpg"; Bitmap tImage = Bitmap.FromStream[new MemoryStream[tClient.DownloadData(mImage)]]; mImage = ImageToBase64(tImage, System.Drawing.Imaging.ImageFormat.Jpeg); It has an error on tClient.DownloadData(imagePath) saying:
Error 7 Cannot implicitly convert type 'byte[]' to 'int'
What's the proper way to define this in C#?