C# Getting path of folder that is created in Visual Studio and it's located in app directory.

Alright i created folder that will contain video resources for my app.But now i need to connect it with my code.I need to get file path of folder that i created in Visual Studio,but it needs to work on other machines.I tryed Path.Combined(Environment.GetCurrentDirectory
+ @"Video\Lekcija1.mp4") but it didn't work.Any suggestions?

If you set the Build Action of the Lekcija1.mp4 file to Content (right-click on the file in the Solution Explorer in Visual Studio) and the Copy To Output Directory property to Copy always or Copy if newer you could use the following code to get the absolute
path to the file:
string codeBase = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
string fullPath = System.IO.Path.GetDirectoryName(codeBase) + "\\Video\\Lekcija1.mp4";
Hope that helps.
Please remember to mark helpful posts as answer to close your threads and please start a new thread if you have a new question.

Similar Messages

  • I need to add a new report to the application that is done using visual studio and SSRS and SQL Server 2008

    I have an application that is done using SSRS on visual studio and it connects to the report server on SQL server 2008 environment.
    I've been changing the existing reports using visual studio 2008 and modifying the reports on the report server. How do I add a new report to the application ? I created a new report and deployed it on the report server but it didn't show up in the application.
    I can access the application source code on visual studio 2010 and TFS (Team Foundation). Thanks. 

    Hi,
    I have a question. This application retrieves SSRS reports from the report sever. When I download the reports
    from the SQL Server I can open them in visual studio 2008 but they don't open in visual studio 2010. I can access the application files on visual studio 2010 and team foundation server 2010. I was unable to open team foundation server 2008 on visual studio
    2008. The issue is that I am unable to add a report with a new name to the application. I use visual studio 2008 to deploy the reports on the report server but it has to be the same name to be able to run the report from the application. I can deploy any report
    on the report server but I can't access it from the application unless it has to be the same name as the present reports. If I keep the report the same name then it will replace the old report and the new report will run from the application. But only if it's
     the same name. I guess when I add a new report to the application with a new name I am supposed to add a definition in the application C sharp files  on visual studio 2010 so that the new report will show in the application. What's your opinion
    ? I have attached 2 images of the application and team foundation server 2010 and the report server.
    Thanks. 

  • I recently upgraded to Lion on an iMac and I am trying to run Garageband but get message telling me that the instrument library is invalid and I should choose a valid Instrument Folder or re-install Garageband. Where do I find such a folder?

    I recently upgraded to Lion on an iMac and I am trying to run Garageband but get message telling me that the instrument library is invalid and I should choose a valid Instrument Folder or re-install Garageband. Where do I find such a folder?

    Thanks very much. Yes, I am using the installer files and serial number from the URL you referenced above. I have spent many hours trying to get it to work. I would love some help!!
    The problem is that the instructions that come in the pdf with the downloaded files do not work, because the files that download from that page do not have the names referred to in the pdf, and most of the things that are referred to in the instructions do not happen. Here is what actually happened.
    When I downloaded the files from the website, these are the files that downloaded:
    I double-clicked each one and they extracted into two different folders.
    Then I read a message on the forum that said to move all the extractred files into the same folder, so I moved all files into one file at C:\Creative Suite CS2\Adobe Creative Suite 2.0 as was pictured in the forum message. Here are screen shots showing all of the files in that folder I have now:
    So then I double clicked the "Setup" file and I got this error message:
    So then I tried to install the programs separately from the installer inside the folders Photoshop and Illustrator. I got this far and entered the serial number from the website:
    But then I got this error message, even though I was using the files and serial number exactly from the website:
    I tried both photoshop and illustrator and the same thing happened.
    (I also looked at Solution 2 that you mentioned above but I don't have anything called VCOM on the computer. Also the error message that I got is not that one.)
    I think I really need a set of instructions that lists the steps in order to do, but based on the files that actually download from the website and what happens when you extract the files. I feel as if I have all of the proper files but it still doesn't work.
    Thank you very much!

  • I have a file that was created in FH 11 and I am using same version.Originator opens file and everything is fine and also earlier version opens it fine.when I open it the links shift 1/8" up and left.Has anybody had this happen to them

    I have a file that was created in FH 11 and I am using same version.Originator opens this file and everything is fine and also an earlier version opens it fine.When I open it it shifts the links 1/8" up and to the left.Has anybody ever had this happen to them?

    What file format(s) are the "links"?
    If raster images, do they contain clipping paths or transparency?
    What is your platform and OS?
    Were the FH documents created on the same platform (Mac or PC) as the one you are currently using?
    Were the linked files created on the same platform (Mac or PC) as the one you are currently using?
    Can you reproduce the problem with a newly created document and the same linked images?
    There was once an issue with transparent 1-bit TIFF images shifting, but I believe that was in a previous version of FH.

  • "Read items that were created by the user" and inconsistent permissions

    Hi!
    I have enabled the option "Read items that were created by the user" and "Create items and edit items that were created by the user" in the advanced settings of a list. Indeed when a user creates an item in that list, that item is visible
    only by that account and other accounts cannot see it.
    However when the user opens the "Shared With" dialog he/she sees all users there, giving him/her the impression that the item is visible to everyone! Why is that? This is very confusing since this "Shared With" feature is the only way
    for a user to tell who can see an item.

    Let it make it more clear. User A creates Item 1. Users B creates Item 2. When User A sees the contents of the list he sees Item 1 only. When User B sees the contents of the list he sees Item 2 only. As expected.
    The problem is that if User A selects Item 1 and then clicks on 'Shared With' button on the ribbon, he will get pop up that indicates that the Item 1 is Shared with User B. Which is not true since User B cannot see the item. So User A wrongly assumes
    that Item 1 is Shared with User B!
    Dimitris Papadimitriou, Software Development Professional

  • I'm a MAC beginner; embarrassed to ask: Although Word, Pages,Key note show in my app list, they won't open.  With Word, I get a pop-up that says it won't open, and then has numerals 1712. Just downloaded Flip Player 2 days ago..what should I do pls??

    I'm a MAC beginner; embarrassed to ask: Although Word, Pages,Key note show in my app list, they won't open.  With Word, I get a pop-up that says it won't open, and then has numerals 1712. Just downloaded Flip Player 2 days ago..what should I do pls??

    It is possible the versions you have are not compatible with your new Mac. Could you please tell us the following:
    1. What OS are you running.
    To get this info, click on the Apple on the top left, then select About This Mac. The OS X version is there.
    2. What are the versions of the apps that are giving you problems?
    To get this info, double click on the hard drive icon and open the Applications folder. Select an application and right click on it. Then select Get Info. The version number is there.
    Version number:
    Not sure I understand your reference to Flip Player - this is not related to the "won't open" problem, is it?

  • When I click on any of my movie or TV shows in Itunes I immediately get an error message that says Itunes has stopped working and closes the program. I can sync the movies and shows to my phone okay but I can't watch on Itunes. Can anyone help?

    When I click on any of my movie or TV shows in Itunes I immediately get an error message that says Itunes has stopped working and closes the program. I can sync the movies and shows to my phone okay but I can't watch on Itunes. Can anyone help?

    Let's try the following user tip with that one:
    iTunes for Windows 10.7.0.21: "iTunes has stopped working" error messages when playing videos, video podcasts, movies and TV shows

  • After downloading the latest iTunes update, when I open Outlook on my pc, I am getting an error meaasage that MoblieMe has encountered a problem and needs to close.  What's up with this?

    After downloading the latest iTunes update, when I open Outlook on my pc, I am getting an error message that MobileMe has encountered a problem and needs to close.  What's up with this?

    You're welcome.
    tt2

  • I just subscribed to IHome but when it tries to gather information about my music library, I get an error message that my Itunes is not responding and then it shuts down. Has anyone else had this problem?

    I just subscribed to IHome but when it tries to gather information about my music library, I get an error message that my Itunes is not responding and then it shuts down. Has anyone else had this problem?

    Thanks so much but none of that helped.  It was driving me crazy because it would back up another external drive.  I just changed the name of the drive from iPhoto/iTunes Library to Media Libraries and IT WORKED!! I guess for some reason it didn't like the drive being called iPhoto or iTunes ???? I don't understand but I have tried so many solutions and exchanging things out but the name change did it????!!!
    Thank you for your help and replying to this.  Guess I made my own issue!

  • I am trg to open a PDF and I am getting a security warning that says allow cancel or block and then it says it needs a signature to open the document I have never had this problem before it is on a public document I am trying to view any help is apperciat

    I am trying to open a PDF in and I am getting a security warning that says block , close , or allow and then it still will not open then it says it needs a signature it is a public document any help is appreciated thank you in advance sorry this is my first time on here

    I have no idea what you're talking about. Are you sure it want a "signature" and not "password"? If it asks you for password then the document is encrypted and you need to know the password toopen it. The fact that it is a "public" PDF, whatever you mean by "public" does not mean anything. If it is not that then:
    Which product are you using, which version (including minor), which platform (Win/Mac), which OS/version? Please, include screenshots of the alerts, warnings that you get.

  • How do I recover a folder that was accidently  put in trash and then deleted:

    How do I recover a folder that was accidently put in trash and deleted?

    If you don't have Time Machine enabled on your Mac you'll need to use a file recovery applicaiton like   SubrosaSoft FileSalvage.  FileSalvage had a demo mode to let you know what it can find and recover before you have to purchase it.  However, it won't be able to recover the folder, only the files in the folder. 
    Other possible file recovery applications can be found at MacUpdate.com by searching there for "file recovery".
    OT

  • When trying to access itunes, i get an error message that MSVCR90.dll was not found and to reinstall the program.

    when trying to access itunes, i get an error message that MSVCR90.dll was not found and to reinstall the program  If I uninstall and reinstall itunes, will I lose my library

    See Troubleshooting issues with iTunes for Windows updates.
    Your library should be fine, but you ought to back it up regularly.
    tt2

  • I have uninstalled and reinstalled iTunes several times, but keep getting an error message that "the registry settings for importing and burning CD's and DVD's is missing".  Can anyone help with this?

    I have uninstalled and reinstalled iTunes several times, but keep getting an error message that "the registry settings for importing and burning CD's and DVD's is missing".  Can anyone help with this?

    It keeps telling me to reinstall iTunes, but it continues to come back with the same error message.

  • I'm trying to set up a sync account but when I get to the window with the "Create a new account" and "Connect" nothing happens when I push either of the buttons.

    I'm trying to set up a sync account but when I get to the window with the "Create a new account" and "Connect" nothing happens when I push either of the buttons.

    By the way, this is in the brand new Firefox 4, not an extension.

  • How do I get old purchused songs that were deleated from my account and my liberary?

    How do I get old purchused songs that were deleated from my account and my liberary?

    It has always been very basic to always maintain a backup copy of your computer for just such an occasion.
    Use your backup copy to put everything back.
    You buy one and only one download.  It is your responsibility to move/copy/backup your music.

Maybe you are looking for

  • File Explorer File Enumeration Slowdown in Windows 8.1 - Why?

    File enumeration in Windows 8.1 appears to be slowing down. Here's what I mean: On a freshly rebooted system (i.e., with few files in the cache), open a File Explorer window on the root folder of drive C:. Select all the files, then right-click and c

  • Show region if field in recordset is NOT empty

    Hi Ive been using dreamweaver's built in "show region if recordset is not empty," but now i need to change the code so that it "shows the region if a field in the recordset is empty" Does anyone know how to do this ? below is my code for "show region

  • IDVD Menu Missing

    I burned a dvd from an iMovie I made and burned the DVD from iDvd. When I play the DVD back it jumps right into movie and does not have a menu come up that gives the person an option to click play. What do I do to correct this?

  • Repeating Table - Copy Row to New Row

    Hi Everyone. I am trying to accomplish something that sounds pretty straight forward but am losing my mind over it. I have a repeating table that shows a list of students on a particular course. This is in a repeating table format with SQL Database a

  • CVS ideas?

    I'm in the process of developing my own Linux system. Not exactly what I would call a distro as yet, but it is early days. Ive got the system to the point where it boots and I can login. It is VERY minimal, now I need to (and am about to) start worki