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 3359382
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:51:55+00:00 2026-05-18T02:51:55+00:00

Problem I have a file which contains such text (nothing else) 2010-10-05 I would

  • 0

Problem

I have a file which contains such text (nothing else)

2010-10-05

I would like to embed this file (content) in the C# code, so I could assign this text to constant (string MyDate), and later use this constant.

Background

What I try to achieve is keeping information about the program in sync — both on website and within program.

The solution has to be:

  • dead simple
  • automatic
  • smooth

The simplest I thought of, would be keeping file “version” with version (actually release date, because it is more meaningful IMHO), such file can be displayed on website with no problem (PHP). I think I manage writing tiny .bat file to auto-generate such file on each build.

But how to use it (embed) in C# code?

I would like to achieve exactly this, or alternative solution but no more complex than this one.

Workarounds

I already know several workarounds, like:

  • creating not only file with just date, but small C# piece of code, which could be directly compiled
  • including this file in installer and after installation reading it, to get the version info

But both do not feel “clean” too me. I need something more smooth 🙂

Background of the background

My program should notify user “hey, there is newer version of the program” on one hand, on the other hand when browsing website info about release date should be displayed on page.

Facts

  • version: date of build which is also release date
  • website: Linux, HTML & PHP
  • program: VS 2010, C# 4.0, single exe
  • installer: Advanced Installer

Edit — solution

I tried to avoid the problem completely and rely on timestamps of the files — it could work, because only one weak point would be the case when you build exe before midnight and create installation package after. However, uploading files to ftp server ruins such plan — you have to make sure ftp server support timestamp modification and you cannot use SFTP protocol.

So, I ended up creating “version” file and not embedding it (because I don’t know how) — I read the content both by PHP script on website and by C# code when executing.

Thank you in advance for your help.

  • 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-18T02:51:56+00:00Added an answer on May 18, 2026 at 2:51 am

    To solve the issue of checking for updates you could: use a WebClient to load a page from your site, and check the version information.

    To solve the issue of displaying version information, you could simply leave a text file called versioninfo.txt in your installer, and load/display that at run time, or as stated by @Daniel you can use a resouce to compile the text file into the binary.

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

Sidebar

Related Questions

I have a problem parsing a XML file which contains special characters like ,
I have a simple text dictionary file, which contains words, separated by ';'.My problem
I have a file in which each line contains two numbers. The problem is
I have the problem running executable .jar file. I've created a project which contains
I have a problem. I have a batch file which imitates the UNIX cd
I have problem with this code: file = tempfile.TemporaryFile(mode='wrb') file.write(base64.b64decode(data)) file.flush() os.fsync(file) # file.seek(0)
I'm working with a C++ sourcefile in which I would like to have a
I have a NetCDF file, which contains data representing total precipitation across the globe
I have a package which contains a csv file which I put in inst/extdata
Newbie question. In Python 2.7.2., I have a problem reading text files which accidentally

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.