What's the best way to reference a file path for ReadAllBytes?

Hi, I'm using VS2013, C# and asp.net webform
I need to read in a Word file into a byte[] using ReadAllBytes().  Should I add this Word file to my project?  If I add this word file (maybe a folder too?) to the project then how can I put as file path for the ReadAllBytes()?  
I really don't like using the hard coded c:\xxx\yyy.docx   unless I must.  I mean when I publish this to the web server the path will change so hard cording path doesn't seem like a good idea to me.
thank you.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
>>I mean when I publish this to the web server the path will change so hard cording path doesn't seem like a good idea to me.

so... you still can put the file into a folder in your website and then read the path of the file relatively.

for example you can use Server.MapPath to returns the "physical path" of the server, which is "relative" in your codes (meaning you no need to hardcode it in your codes)

HttpServerUtility.MapPath Method

similarly, you can also refer to:

HttpRequest.ApplicationPath Property

HostingEnvironment.ApplicationPhysicalPath Property

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
You just use


The ~ means from the root folder of your application. The folder you specify in IIS when setting  up the application
lapuccaAuthor Commented:
Thank you, that worked.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.