|
There may be a So many reasons for this..,
can you post the Process Code snippet Here..
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
bool isRunningFirst = true;
ProcessStartInfo ps = new ProcessStartInfo("telt.exe");
ps.Arguments = "D:\test.txt";
ps.WindowStyle = ProcessWindowStyle.Hidden;
Process prcs = new Process();
prcs.StartInfo = ps;
prcs.Start();
Process prcs2 = new Process();
if (prcs.HasExited)
{
string[] files = Directory.GetFiles(tempFolderpath, "*.txt");
ProcessStartInfo ps2 = new ProcessStartInfo("telt.exe");
ps2.Arguments = files[0] ;
ps2.WindowStyle = ProcessWindowStyle.Hidden;
prcs2.StartInfo = ps2 ;
prcs2.Start();
}
while (isRunningFirst)
{
if (prcs.HasExited && prcs2.HasExited)
{
isRunningFirst = false;
fill_datagrid();
}
}
please ignore the "telt.exe" just a small tool. here in the while i get the exception only for the prcs2.HasExited
|
|
|
|
|
While Process.Start() can throw some exceptions, it also returns a boolean; you should check its value. Start() may fail, e.g. when your exe isn't present, or its containing folder isn't in the Windows PATH.
|
|
|
|
|
follow the above answer..,
why don't you use ps.WaitForExit(); for Process to complete ....
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
How can i restrict a file so it cant be opened in any windows.
cause i wanna to save my password in file and nobody cant see it.
just lock the file without passowrd.
I have serialized my pass but i wanna to deny Access to this file in all windows just in program i access to it.
|
|
|
|
|
I am not sure that there is any mechanism for protecting a file in this way. The safest way is to encrypt the contents and use a custom program to access it. There are plenty of samples around on encryption that you could implement fairly quickly. Alternatively there are a number of password programs available that already provide this feature.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
You can't.
It's that simple.
Think about it: If no program can see the file content, how do you read it?
Unless you encrypt it, and provide a password to decrypt it. But then, you will need a encrypted file to hold the decryption key for the password to the password file. And then you need...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
As you aren't part of the operating system, you can't restrict access to the files. Sure, you could add a group policy that would restrict the file from being opened, but there's nothing to stop somebody from taking your file onto another machine and open it there.
|
|
|
|
|
The only way I can come up with is writing a Windows service that opens the file with exclusive read access, and at that point, no other application can open the file.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
|
Hello. I am using the purecomponents component at programming. But when I run the program, monitor screen as if rendered or to be refreshed constantly flik. Also font of Reports in Crystal Report viewer To be cluttered, and also puts together its readability is lost. I advise you ask me.
It is noteworthy that I use visual studio 2008 for programming and also use c# languages.I also ask about the source code to fix this problem if c # language give you my place.
I cannot Write English well , therefore I send you a notice attach image of the report in Crystal report viewer until . plz help me!
my program view :
http://www.4shared.com/photo/9MmoTjCv/pic1.html
my report show in crystal report view Before opening a form that the purecomponents used in.
http://www.4shared.com/photo/tDenI7RY/pic_1_1.html
my report show in crystal report view after opening a form that the purecomponents used in.
http://www.4shared.com/photo/6oyaISOc/pic2.html
Upon opening the form shown in the figur 1 of all reports in a manner similar to Crystal Report viewer that came in the third picture to come and be upset.
Before using this component was not the problem.
But as long as I have not run the form seen in Figure 1 which in purecomponents is used , no problem with displaying reports. Upon opening the form seen in Figure 1, the form's background start to little flick (vibration) and in this case all the reports will show puts together and this process continues until the program once I would open and close.
I'm using this Vendor of Crystal Reports in my other programs too . But such is not just about a program in which the components have used this problem to occur.
Thank you.
|
|
|
|
|
Please do not post this in multiple places: here and Q&A. All that does is duplicate work and annoy people.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Hi
I'm writing an outlook addin in VisuaStudio 2008 using the buildin Outlook addin project template of VS2008.
In my code I added a new button to one of the ActiveExplorer() commandbars.
I made it changed according to the number of items selected in the ActiveExplorer
using Application.ActiveExplorer().SelectionChange event.
this works just fine up until I click on the button and load my winForm. after doing so it seems like the Application events that I used (including : SelectionChange and ItemContextMenuDisplay) stopped triggered. and the button as a result stopped changing according to the number of items selected.
The winform is empty and loads up as ShowDialog.
Any ideas why and how to fix it? tnx leeoz
here is part of the relevant code (I only missed out the AddMenuBar(), ThisAddIn_Shutdown() and the other events which have the same problem after showing this winForm):
private void InternalStartup()
{
this.Application.ItemContextMenuDisplay +=new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemContextMenuDisplayEventHandler(Application_ItemContextMenuDisplay);
this.Application.ContextMenuClose +=new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ContextMenuCloseEventHandler(Application_ContextMenuClose);
this.Application.ActiveExplorer().SelectionChange += new Microsoft.Office.Interop.Outlook.ExplorerEvents_10_SelectionChangeEventHandler(ThisAddIn_SelectionChange);
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
void ThisAddIn_SelectionChange()
{
if (btnManualFiling != null)
{
if (this.Application.ActiveExplorer().Selection.Count > 0)
{
btnManualFiling.Enabled = true;
}
else
{
btnManualFiling.Enabled = false;
}
CurrentSelection = this.Application.ActiveExplorer().Selection.Count.ToString();
btnManualFiling.Caption = TomaxManCaption + "(" + CurrentSelection + " items)";
}
}
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
AddMenuBar();
}
private void buttonOne_Click(Office.CommandBarButton ctrl, ref bool cancel)
{
frmManualFiling wnd = new frmManualFiling(this.Application);
wnd.ShowDialog();
wnd.Dispose();
wnd = null;
}
|
|
|
|
|
|
So I have read this and know all of this before...
Still no answer to my question.
I understand that while the dialog is open the owner is puaused untill I close the dialog.
But my problem is after I close the dialog, the addin is still running ok, but all the events I've added from the beggining stopped from firing (i.e. while I change my selection I don't get the event to fire again).
Why and how to fix this, I don't know...?!
tnx
|
|
|
|
|
Ok, I missunderstood your first post.
Have you manually modified the InternalStartup method implementation to add the other event handlers? You shouldn't. It is better to place that into your Startup event handler.
Anyway, I have made a little plugin to test and get the same problem as you. I will try to find out what is going on and will tell you if I find something.
modified on Tuesday, October 26, 2010 11:02 AM
|
|
|
|
|
Ok, I can tell you how to fix it, though I can't tell you why, and after so many years fighting against MS-Outlook API, I have learned to yield in some cases and just look for a good work around.
Instead of this line you have:
Application.ActiveExplorer().SelectionChange += new Microsoft.Office.Interop.Outlook.ExplorerEvents_10_SelectionChangeEventHandler(ThisAddIn_SelectionChange);
Use a class level field to hold the explorer, and then set the event handler on it:
Microsoft.Office.Interop.Outlook.Explorer exp;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
exp = Application.ActiveExplorer();
exp.SelectionChange += new Microsoft.Office.Interop.Outlook.ExplorerEvents_10_SelectionChangeEventHandler(ThisAddIn_SelectionChange);
...
}
It works this way... Don't ask me why... I just don't even want to know.
|
|
|
|
|
tnx.
BTW should I do the same for Application.ItemContextMenuDisplay event?
i.e.
private this.Application app;
..
{
app.ItemContextMenuDisplay += new...
}
???
|
|
|
|
|
Dear friends,
This is head ache for me to handle this.
i got one link to overcome this issue.. which is given below
http://wiki.asp.net/page.aspx/1137/preventing-multiple-button-clicks/
its really grate but this is making issue for me
my submit button is asp button which have Validation Group = 'Transfer'
i have multiple text box on form which is handle dynamic when there is one scenario it is add Validation Group as 'Transfer' and remaining as 'NA' and vice versa.
issue is create when this submit button click it is validate the page at this time it is validate each and every control even that control is having Validation group as 'NA'.
Can any one help me to overcome this issue.
Sasmi
|
|
|
|
|
|
i have a project in c# code and 3 leyer; and all of data base code are in data leyer, which method is better?
1- send sql string statementto data base for select or update?
2 - using stored procedure?
in databases with larg scale wich is better?
pleas help me?!
|
|
|
|
|
Stored procedures are better than using SQL statements in your code.
sa.alavifar wrote: in databases with larg scale wich is better?
Depends on what are your options. SQL and Oracle are two from which you can choose.
|
|
|
|
|
Using a stored procedure is generally considered better. The SQL Server can create an execution plan which speeds the execution up. You also get built in protection against SQL injection attacks.
Whatever you do don't use an SQL string statement like this (without parameters):
string sql = "Select * from Table where name = " + idTextBox.Text;
as a hacker can type in SQL to the text box idTextBox and manipulate your DB, this is called SQL injection. Because Stored Procedures use parameters anyway, they are protected against this.
Finally, I'd suggest looking at the following: LinqToSql, The Entity Framework, NHibernate. These map C# objects to relational databases, you will find that this removes the need for a lot of boilerplate code. It looks like you have a new development, so using these technologies will probably be better, but YMMV.
|
|
|
|
|
<br />
string sql = "Select * from Table where name = " + idTextBox.Text;<br />
when i have an update, i was using the parameter that they are protected against SQL injection
i asked this question for example initial datagrid view in form laod,
so what is your idea?
|
|
|
|
|
This is still wide open to a SQL Injection attack. Just because it's a select statement, doesn't stop it from having a SQL Injection attack attached to it.
|
|
|
|