i'm having problems with URL [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I am using this code
axWindowsMediaPlayer1.URL = #"c:\myvideo.avi";
but when the video file containing folder changed this code is not working.i need to set an permanent URL even though the file containing folder is changed.

You can’t find the file if it’s location was changed. Imagine if the user moved it to another drive or permanently deleted it - what would you do then?
If you’re changing folder within your application then of course you can track where the file was placed and correspondingly change the path. But if the path was changed outside of your app you can’t do anything with it.

Related

How to use the automatic set up feature in Visual Studio and how reference a file location automatically [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Okay, so hopefully the issue was explained properly in the title, but if not then basically in my program I have an array which is loaded with a ton of data straight off a .csv file when the program is launched and so I need to make it so that when the set up is run the file destination of the .csv in the code is correct.
Otherwise it won't load the array with anything and so ultimately my question is how do I do that? Here are some screenshots of what I've already tried, and some snippets of code, if anyone could even point me in the direction of a YT video that may even be helpful enough, thanks StackOverflow users. https://pastebin.com/cEmZxujx
Maybe check the reference with
System.IO.File.Exists("filename")

Is it good practice to save the Images/Files in the current working directory in c# project [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Is it good practice to save the Images/Files in the current working directory in c# project. Or it is better to save them as other project files and folders independent of the program execution.
Better to use a safer place instead execution location. Take a place where the user has file write access like Documents, AppData etc. Because the application might be run in the different place where in some places possible user has no file write access, then you won't be able to save any images/files there.
This is an opinion based question. But still I will share my opinion.
You can keep all the images within a specific folder within your project. Such as an Image folder or whatever name you would like to give it.
While adding the item to your project, you can click on properties of the image and specify the Build Action to Resource in the properties window.
Specify the UriSource property as :
UriSource="/images/abcd.png"
That URI is effectively a Resource File Pack URI,and the prefix would be automatically added, so you need not worry about copying the image file to output directory.

Moving large files to different directory [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a 10 GB folder(myfolder) that has lot of files used in an web application. Every week, this gets recreated in a different folder(mynewfolder). I want to move old files to a diff directory and move newly created ones to the right folder without user noticing (or very less down time). I can either do it in C# program or a batch file. Which is a better option? How can I do it in batch file?
C:\myfiles\myfolder --Existing
C:\myfiles\mynewfolder -- newly created
Thanks
MR
Huh? Just rename myfolder as mynewfolder. It doesn't take any time at all regardless of how much data or how many files are in there.
rename myfolder mynewfolder

when i try to upload a .flv video to a folder it says "count not fine the file "test.flv" (the file is in my desktop though) [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
//if video is .flv format save file to the specific folder
if (upExtension == "flv")
{
File.Copy(fileupVideo.PostedFile.FileName,Server.MapPath("../"+playFile));
operateMethod.catchImg(Server.MapPath("../" + playFile), Server.MapPath("../" + imgFile));
insertVideoInfo(playFile, imgFile);
}
You might want to try fileupVideo.SaveAs instead of File.Copy. fileupVideo.PostedFile.FileName will retrieve the name (and POSSIBLY the path) of the file on the client-side. You can't access that from the server-side, and should use .SaveAs to save it to a file on the server first.

C# : file copy notifying [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
hi i am creating a c# application that monitor the files that has been copied , the aim of program is to alert user that there is a file has been copied , i know the file system watcher class , but it has only 4 events , change or create or delete or rename , is there a way to know if file has been copied in or out of system ?
When a file is copied into the system you will also get a change or create event. But if it is simply accessed (which is what happens when it is copied) FileSystemWatcher is of no use.
You can use Auditing file and folder access feature of Windows.
The task makes no sense. First of all, there's no "copy" operation on the OS level. Copy is a sequence of open/read/close (source) + create/write/close (dest) operations. Now, even if such operation existed (eg. Explorer has such concept), what about archiving the file and then copying out the archive?

Categories

Resources