joneK
joneK

Reputation: 241

How can i set a new file name and directory?

I have a contextMenuStrip1 in the designer and two menus one to change the file name and one for the directory .

What i want is to make that when i click on change file name i will type inside the file name only the name of the file click ok and the name of the file to be created will be changed .

Second is the directory same thing i want when clicking on it it will change the directory name and location i selected.

In my Form1 i have this line :

ffmp.Start("test.avi", @"d:\", 25);

"test.avi" is the file name i want to be able to change . And @"d:\" is the directory i want to be able to change .

So instead the file name and directory there will be some default variables with file name and directory already and somehow i will be able to change this variables throuh the application when it's running ,

Upvotes: 0

Views: 130

Answers (1)

Idle_Mind
Idle_Mind

Reputation: 39132

Add an OpenFileDialog() to your form and use it to get a filename from the user. You can extract the filename and folder using Path.GetDirectoryName() and Path.GetFileName(). Store those values in variables at Form level and then use them in your ffmp.Start() call.

Upvotes: 1

Related Questions