|
OK,
You can send me it to michgr@nana.co.il
thanks very much
|
|
|
|
|
i have sent a mail also to you i was in hurry so without subject
|
|
|
|
|
OK thanks,
I will try it and let you know
|
|
|
|
|
Hi,
The code you sent me works fine, but very very slow. My code works much faster:
foreach (string d in Directory.GetDirectories(Start_dir))
{
if (!d.Contains("Shared Documents") && !d.Contains("Anna") && !d.Contains("CE Group") && !d.Contains("DEF") && !d.Contains("DtReport")
&& !d.Contains("images") && !d.Contains("Lists") && !d.Contains("MMGBD") && !d.Contains("Site") && !d.Contains("SP Requests")
&& !d.Contains("STAM") && !d.Contains("Training") && !d.Contains("uptest") && !d.Contains("X5") && !d.Contains("X8")
&& !d.Contains("Form") && !d.Contains("Yonah"))
{
//System.Threading.Thread.Sleep(200);
foreach (string f in Directory.GetFiles(d))
{
//System.Threading.Thread.Sleep(200);
//MessageBox.Show(f);
m=f.Replace("\\"+"\\moss.ger.ith.intel.com\\sites\\MPGBD-03\\HAL\\PD\\","");
//MessageBox.Show(m);
if (m.Contains(search1))
{
MessageBox.Show("found");
//System.Net.WebClient client = new WebClient();
//client.UseDefaultCredentials = true;
//client.DownloadFile(f, @"c:\\123.gif");
//Process.Start(@"c:\\123.gif");
//System.Threading.Thread.Sleep(500);
//Process.Start(f);
review_file_found = true;
return;
}
}
dirsearch(d, search1);
}
}
The problem is that with this code (with the messagebox.show("found")
it finds the file (the message appears).
But when i usethe process.start and try to open the file or even to download it it seems as it doesn't see the file at all (some files it sees and some not). It seems as it doesn't enter the if condition at all (even don't do the -
review_file_found=true
because outside this method i check the status of the bool and show a messagebox says the file not found. But the program does find it if i don't do the process.start
Maybe i need to use another way to open the file?
Here is an example of the file path:
\\moss.ger.ith.intel.com\sites\MPGBD-03\HAL\PD\Puma M Reviewd FIB edits\002_pumam_b0_flsh2.GIF
|
|
|
|
|
|
Help me to take sql server 2000 database backup using VS.net 2008 using
C# code.
|
|
|
|
|
0.33 seconds of google search gave me these [^]results
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi
This Code might help you.
we have to create 2 textbox 1 of name - dbName
textbox 2 of name - txtLocation
private void button1_Click(object sender, EventArgs e)
{
SqlCommand cmm = new SqlCommand();
SqlConnection cn = new SqlConnection("server=.;database=" + dbName.Text + ";user=sa;password=tiger123");
cn.Open();
cmm.CommandText = "BACKUP DATABASE " + dbName.Text + " TO DISK = N'" + txtLocation.Text + "\\Intermidiate_backup_200905291809.bak' WITH NOFORMAT, NOINIT, NAME = N'Intermidiate_backup_20090529180939', SKIP, REWIND, NOUNLOAD, STATS = 10";
cmm.CommandType = CommandType.Text;
cmm.Connection = cn;
cmm.ExecuteNonQuery();
}
Thanks & regards
Satish Pai B
|
|
|
|
|
public static void BackupDatabase(string DataBaseName , string Backupfile , string Description )
{
SqlCmd = new SqlCommand("BACKUP DATABASE @DataBaseName TO DISK = @Backupfilepath WITH INIT , DESCRIPTION = @Description", SqlCon);
SqlCmd.Parameters.AddWithValue("@DataBaseName", DataBaseName);
SqlCmd.Parameters.AddWithValue("@Backupfilepath", Backupfile);
SqlCmd.Parameters.AddWithValue("@Description", Description);
SqlCmd.ExecuteNonQuery();
}
I know nothing , I know nothing ...
|
|
|
|
|
In my application, I have a task which is running on a background thread. I need a notification in the background thread when ever a MessageBox or any modal dialog is displayed in the UI thread.
Though I can do it manually by calling some function before displaying the MessageBox, but it will be great if I dont have to.
For e.g.:
backgroundThread.MessageShown();
MessageBox.Show("Task halted!");
I am guessing there might me some message which can be hooked on to. Even in the main GUI thread, is there any message/event that get fired just before a modal dialog is shown?
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
Why should a task that runs on a worker thread need to know of it every time a message box is shown in the UI? This sounds strange to me. Perhaps there is a better way to do it, but only if you explain what you are trying to achieve.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Okay, here is the requirement. I have some tasks which are done on the UI thread, and I have to show progress on a separate dialog, which is been shown on a worker thread. I understand that it should be the tasks which must be done on worker thread, but the current scenario cannot be changed for the time being.
Every thing is working fine, except for one glitch - if a message box is shown in the UI thread, it gets hidden below the progress dialog. So the user never gets to know that UI is waiting for an input. I need a way to get notified that a modal dialog box has been shown and I should hide the progress dialog.
Right now, I have to hide it explicitly just before every call to MessageBox.
I hope that explains.
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
The NULL DeveloperI have some tasks which are done on the UI thread, and I have to show progress on a separate dialog, which is been shown on a worker thread.
This defeats the purpose of a worker thread (because it cannot happily do its work on the background), and defeats the purpose of having the main thread as an UI thread (which is a thread with a message pump and you have blocked it with some lengthy processing). Blocking the message pump is just atrocious.
The NULL DeveloperEvery thing is working fine, except for one glitch - if a message box is shown in the ...
No! The glitch is that you are blocking the application's message pump. Just please have the worker thread do the lengthy processing and let it also notify the UI of the progress.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh, I fully agree with you, as I had mentioned and as I had said, this scenario cannot be changed because these are already existing applications written that way. And that application is HUUUUUGE!
So I had to do it the other way.
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
I agree with the others that the design is flawed but you seem to be aware of that.
You could wrap the message box call into your own static method with the call to the backgroundThread and MessageBox.Show, and call your method instead each time.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Dave, that will serve the purpose for MessageBox only. What about existing custom modal dialog boxes?
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
The NULL Developerand I have to show progress on a separate dialog, which is been shown on a worker thread
So you're saying that the progress dialog is launched by the background thread instead of the UI thread? If so, there's your problem. ALL UI, including the progress dialog should be created on the UI thread, not a background thread. You can invoke a method from the background thread to update the progress bar. If you can't change this, you're pretty much screwed. There is no notification your app is about to create a new dialog.
|
|
|
|
|
|
The CBT Hook is what would be looking for but it's a huge overkill solution to the problem of showing the window on the wrong thread in the first place.
|
|
|
|
|
I agree with Rajesh. This sounds like a very bad design to me. What are you ultimately trying to achieve with this?
|
|
|
|
|
Hello,
I just performed 8 searches on CodeProject for "Rich TextBox Ruler" because I want to add a ruler to my text editor project and, I also changed the search phrase around but it kept on showing "No results" page but the other day there were heaps... Does anybody know how I can add a ruler to my text editor project, or know any links for articles?
Thanks all,
jason
|
|
|
|
|
How about this[^] one?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
a metric ruler?
the EU will only go that far.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
hehehe, I'm not sure of the correct name for it, but I'd like the same type of "ruler" as you would see in Microsoft Word, for example.
Jase.
|
|
|
|
|
Hi
http://www.codeproject.com/KB/miscctrl/ruler.aspx
This might help u
|
|
|
|