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

  • Home
  • SEARCH
  • 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 8447219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:07:52+00:00 2026-06-10T10:07:52+00:00

I am using the following code in c# to download a file from my

  • 0

I am using the following code in c# to download a file from my website:

WebClient webClient = new WebClient();
webClient.Credentials = new System.Net.NetworkCredential("username", "password");
webClient.DownloadFile("http://example.com/file.txt", "file.txt");

The file is only downloaded when certain criteria are met, so I don’t want the users to be able to access the files on my site

My corcern is that if a curios users decompiles the code, he will find the password and be able to access all the files on my site.

I’ve read that a secure way to save the password is to store its hash, but I don’t know how to implement it in this example.

What options do I have to keep my password secure and make it impossible for a user to find it?

  • 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-06-10T10:07:53+00:00Added an answer on June 10, 2026 at 10:07 am

    You simply don’t. Users give you passwords to do stuff, not the other way around.

    If the user has to prove “certain conditions”, then pass proof of those certain conditions to the server, and let it decide whether to allow the download or not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to download a file from a website using the following code:
I’m using the following code to download a file from a remote ftp server:
Using the following code, I can download the HTML of a file from the
I am using the following code to download a file from my server then
I am trying to download a zip file by using the following code; HttpConnection
I'm using the following code to download a pdf from a list of pdfs
I am using the following code to download files from the internet: size_t write_data(void
I have download the code for OpenFileDialog (File Upload function) from Silverlight tutorials website.
I am using the following line of code to download the contents of an
I am using the following lines of code to download and save an html

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.