Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 555217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:47:31+00:00 2026-05-13T11:47:31+00:00

I have an image on my drive, I encrypted the bytes by adding a

  • 0

I have an image on my drive, I encrypted the bytes by adding a numerical value, now how can I write that modified file and replace the old one?

Here’s my encryption method [very newbish because I’m just getting a feel for things 😛 ]:

    private void EncryptFile()
    {            
        OpenFileDialog dialog = new OpenFileDialog();
        dialog.Filter = "JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif";
        dialog.InitialDirectory = @"C:\Users\Sergio\Desktop";
        dialog.Title = "Please select an image file to encrypt.";
        if (dialog.ShowDialog() == DialogResult.OK)
        {
            byte[] ImageBytes = File.ReadAllBytes(dialog.FileName);

            for (int i = 0; i < ImageBytes.Length; i++)
            {
                ImageBytes[i] = (byte)(ImageBytes[i] + 5);
            }                
        }             
    }

I’m stuck there. I don’t really know how to procede. Technically, after that for loop, I have my modifed image inside of the byte[] ImageBytes. Now how can I write it in the exact same location as the image?

Woah! On a side note, am I reading the file correctly by using dialog.FileName. Does that return the file’s path?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:47:32+00:00Added an answer on May 13, 2026 at 11:47 am
    File.WriteAllBytes(dialog.FileName, ImageBytes);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 289k
  • Answers 289k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The best way is probably to subclass UITableViewCell and to… May 13, 2026 at 5:36 pm
  • Editorial Team
    Editorial Team added an answer If you want this done exclusively by MYSQL and without… May 13, 2026 at 5:36 pm
  • Editorial Team
    Editorial Team added an answer I'd think looping through every site from code is very… May 13, 2026 at 5:36 pm

Related Questions

I've got a mysterious problem with images and caching. In my project I've got
I've got an image on a page rendered by Firefox via Webdriver, I can
For my new asp.net application that I am developing I would like to generate
Spurred on by success stories of developers using VMs I've decided to give it
I'm in the process of teaching myself WPF, and I have run into a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.