Monday 30 January 2017

C# ASP.NET Hide Image Path on the Page

public void DrawImage(string imageURL)
{
    // convert image to bytes array
    WebClient wClient = new WebClient();
    byte[] imageBytes = wClient.DownloadData(@imageURL);

         // create memory stream of bytes array and convert image to base 64 and display it

    MemoryStream imgStream = new MemoryStream(imageBytes);
    ImageBox.ImageUrl = "data:image/jpg;base64," + Convert.ToBase64String(imgStream.ToArray(), 0, imgStream.ToArray().Length);
}

*ImageBox is a image control on the page.
*Sample call: DrawImage("c:\windows\image.jpg")



Upgrade Windows 11 Home to Windows 11 Pro

Disable internet connection (Wi-Fi, Internet, etc.) Change the product key using the following Generic product key:                     VK7J...