|
Hi
I have some zip files in a directory and want to copy them to another directory with the same of source files. Could any one please tell me.
DirectoryInfo di = new DirectoryInfo(zipsPath);
di.Attributes = FileAttributes.Normal;
FileInfo[] zFiles = di.GetFiles("*.zip");
string tempZip = "/Programme/tempZips";
if (!Directory.Exists(tempZip))
Directory.CreateDirectory(tempZip);
//FileInfo[] tmpFiles = di.GetFiles("*.zip");
foreach (FileInfo file in zFiles)
{
file.CopyTo(tempZip, true);
}
will the above code works.
thanks
|
|
|
|
|
DirectoryInfo di = new DirectoryInfo(zipsPath);
di.Attributes = FileAttributes.Normal;
FileInfo[] zFiles = di.GetFiles("*.zip");
string tempZip = "/Programme/tempZips";
if (!Directory.Exists(tempZip))
Directory.CreateDirectory(tempZip);
for(int a=0;a< FileInfo.Lenght;a++)
{
File.Copy(FileInfo[a].FullName, tempZip, true);
}
run this code, i hope it will work
Becoming Programmer...
|
|
|
|
|
Hi
thank you very much for your reply. I want to remove the files in the source direcory, after copying to new directory. To do this, can I use File.Move() instead of File.Copy() and File.Delete().
thanks
|
|
|
|
|
as you wish, AFAIK Move() may little bit slower than Copy() then Delete()
Becoming Programmer...
|
|
|
|
|
Hi
I have created a splash screen on my own i want my original screen to be appear completely before the splash screen vanishes ....please if any one knows how to calculate the loading time of the form then please do let me know
this is my code for the splash screen
>>> Timer is calling this function .....so its the starting form of mine
private void check(object sender, EventArgs e)
{
if (i < 1 && status == true)
{
this.Opacity = i;
i = i + 0.1;
if (i > 0.9)
{
status = false;
}
}
else if (status == false)
{
this.Opacity = i;
i = i - 0.1;
}
if (i < 0.1)
{
timer1.Stop();
this.Hide();
printsoftwareparent psf = new printsoftwareparent();
psf.Show();
}
}
its me sid
|
|
|
|
|
I suspect you can calculate form loading time only approximately if you can at all so instead I suggest that the main form signals splash screen form when finishes initialization.
|
|
|
|
|
hi thanks for ur reply
I want the application to be started like Acrobat Reader or PhotoShop
If u know how to do this then please do let me know
its me sid
|
|
|
|
|
You can start other applications using Process class but I don't think you will be able to estimate their load time.
|
|
|
|
|
Maybe not a very good way of doing it, but how about getting DateTime.Now when your app starts, and DateTime.Now when it's finished loading, calculate the difference. Should give you a fairly accurate time.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
He is interested in knowing load time before the application has loaded.
|
|
|
|
|
insert a timer in your form and enable it after all code in Form Load event, like:
private void Form1_Load(object sender, EventArgs e)
{
timer1.Enabled = true;
}
then in timer1_Tick event, show your splash screen.
if you want to delay in showing splash screen then just increase the timer1 interval
NOTE: Do not forget to disable timer, you can disable it in timer1_tick event.
private void timer1_tick(object sender, EventArgs e)
{
timer1.Enabled = false;
}
hope it will help.
Becoming Programmer...
|
|
|
|
|
Thanks for the suggestions ...in mean time i have done something its working satisfactory but not as i expected
private void check(object sender, EventArgs e)
{
if (i < 1 && stat== true)
{
this.Opacity = i;
i = i + 0.1;
if (i > 0.9)
{
stat = false;
printsoftwareparent psp = new printsoftwareparent();
psp.Show();
this.BringToFront();
}
}
else if (stat == false)
{
this.Opacity = i;
i = i - 0.1;
}
if (i < 0.1)
{
timer1.Stop();
this.Hide();
}
}
its me sid
|
|
|
|
|
you have said that you want to show splash screen just like Acrobat Reader
that mean the splash screen should show after the Form1.
as i read your code, you are trying to show Splash screen as fading
but you doing little wrong, read my previous post carefully that will help you
Becoming Programmer...
|
|
|
|
|
I would like to clear...what i said
Firstly the splash screen comes and in the background the software parent form gets loaded as the form screen disappears with in no time the parent form must appear
splash screen is shown to hide the slow loading of the parent form
i hope i am clear
regards
sindhu tiwari
its me sid
|
|
|
|
|
TRY THIS !!!!
in timer properties..set Enabled to true and interval to 1
private void SplashScreen_Load(object sender, EventArgs e)
{
timer.Enabled = false;
this.Opacity = 0;
}
private void timer_Tick(object sender, EventArgs e)
{
if (Splash > 2)
{
timer.Enabled = false;
this.Hide();
frmLogin Login = new frmLogin();
Login.Show();
}
else
{
Splash += 0.01;
this.Opacity = Splash;
}
}
|
|
|
|
|
hello,
I am storing some of my GUI settings in config file which is accessible to user. If user changes the settings then application has to be restrted with the updated settings.
As soon as settings are changed and saved i am doing Application.ExitThread();
and calling Application.Restart();
I found that Application.Restart() is not consistent. I am facing two problems here:
1). Some times it does not reflects the updated settings to config file before restart and start with previous settigns only.
2). Some times it doesn't terminate the current aprocess before starting the new application process.
Is there any better way to use Application.Restart() or so simply to restart the application?
Thanks.
|
|
|
|
|
You can create a bat file which kills your application and starts it.
|
|
|
|
|
try this:
Application.Exit()
Application.Restart()
Becoming Programmer...
|
|
|
|
|
Hi Guy
No need call exit() method, when call Application.Restart(), this command to tell to AppDomain get the Expoler url with this porcess name, and store in the AppDomaian, after a few seconds automcatically wrapper the anotehr and call this url in the explorer(NOT Internet expolrer). and start the process.
Thanks
Cheers
RRave
MCTS,MCPD
|
|
|
|
|
Buddy the Application.Restart() restarts the application as another process but it dont closes the Current running app. so to close it we need to call Exit()
Becoming Programmer...
|
|
|
|
|
|
oh yeah, but some days ago when i used Restart() then it created new instance but didnt close the current running app, so to do that i used Exit()
Becoming Programmer...
|
|
|
|
|
hi
I am creating travels project, in left part of my datagrid of my default page i placed all the products such as india tour ,world tour etc and if v click any product it will redirect to itennary page according to their ID's
my problem is if i added new product such as Hotel Booking in the datagrid and after clicking it then i want to place textbox and a button in the itenary page and if v click india tour or world tour i want those textbox and button should be not visible
Please try to solve my problem,its very urgent
thankn you in advance
raghu
hi
i want to populate country's name in 1st dropdownlist and their states should be placed in the 2nd dropdownlist, if we select any state it should place the name of the capital in the textbox besides that and so on.....
If possible send me code
thank you in advance
raghu
|
|
|
|
|
Refer this link Google[^]
raghu.chanti wrote: hi
i want to populate country's name in 1st dropdownlist and their states should be placed in the 2nd dropdownlist, if we select any state it should place the name of the capital in the textbox besides that and so on.....
If possible send me code
Your signature looks awkward
Sathy
|
|
|
|
|
Hello Friends,
I am developing an windows application in C#.NET.
I want to make text box multilingual means it can take input in any language..
|
|
|
|