|
Note the difference between the Windows Form object and the window it actually has opened. You could close the window, while keeping the form object alive. I think now you know what to do.
Best,
Jun
|
|
|
|
|
Hi Jun,
I got it from your clue..
Thank you very much for giving me the clue exactly in the right manner.
Regards
|
|
|
|
|
I am trying ot run this programm from a windows form application but at command line it stops with message:
"Reading passphrase from file descriptor 0 ..." and nothing happens.
Same program run fine on command line with follwoing line:
C:\Program Files\GNU\GnuPG>gpg --passphrase-fd 0 < c:\gnupg\passphrase.txt -o c:\HIF\Clock.swf -d c:\gnupg\Clock.gpg
This is a command to decrypt the file using GnuPG encryption and decryption program.
Any help is most welcome.
Code Snippet:
string strArg = @" --passphrase-fd 0 < c:\gnupg\passphrase.txt -o c:\HIF\Clock.swf -d c:\gnupg\abc.gpg";
process.StartInfo.FileName = @"C:\Program Files\GNU\GnuPG\gpg"; OR "gpg"
process.StartInfo.Arguments = strArg;
process.StartInfo.RedirectStandardInput = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
try
{
process.Start();
process.WaitForExit(5000);
string str = process.StandardOutput.ReadToEnd();
}
catch(Exception ex)
{
string str = ex.Source + ex.Message + ex.StackTrace;
}
Bharat Gadhia
In life, failures teach you as much as — or perhaps more than — successes.
Thank you very much for the help.
|
|
|
|
|
process.WaitForExit(5000);
The first question I would have is, is this enough time for the process to complete? Have you tried to increase the timeout, or not use it at all?
only two letters away from being an asset
|
|
|
|
|
Thank you.
yes I have done that too. I increased time to 40000 but after process exits the cmd screen still shows
Reading passphrase from file descriptor 0 ...
and it waits there till one hits manually enter button and then it comes out and at
string str = process.StandardOutput.ReadToEnd();
value of str string is empty.
So it seems that same command which reads passphrase.txt and passes to passphrase in command line operation does not do the same in windows form application.
By the way there was a small mistake in strArg value, It is as follows:
string strArg = @" --passphrase-fd 0 < c:\gnupg\passphrase.txt -o c:\HIF\Clock.swf -d c:\gnupg\Clock.gpg";
Bharat.
In life, failures teach you as much as — or perhaps more than — successes.
Thank you very much for the help.
|
|
|
|
|
Try reversing the calls
string str = process.StandardOutput.ReadToEnd();
process.WaitForExit(5000);
rather than
process.WaitForExit(5000);
string str = process.StandardOutput.ReadToEnd();
only two letters away from being an asset
|
|
|
|
|
Thank you.
I did that but the cmd screen waits with followong message at the call to the function process.StandardOutput.ReadToEnd()
Reading passphrase from file descriptor 0 ...
Bharat.
In life, failures teach you as much as — or perhaps more than — successes.
Thank you very much for the help.
|
|
|
|
|
please tell me if there is a way to run my project in c#.net 2005 on Linux platform
i heard about grasshopper and mono
1--> which one is better
2--> what i should do to make that happen
(any intigration with visual studio.net or recompile the code)
|
|
|
|
|
Use Mono
You can first try to compile it on both Windows and Linux. If it compiles and runs on Windows, check if it compiles and properly runs on Linux, too.
The mcs compiler is for .NET 1.1 and the gmcs for .NET 2.0 as far as I remember
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
thanks Greeeg
you seem to have a better knowledge of the topic will you please mind to put some more information so that everybody reading this get the benefit
|
|
|
|
|
There are already some articles on this site that explain it very well. Just type "Mono" into the search box at the top.
Here are two vey good ones:
Number 1
Number 2
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
Hello. Is there any way to read one by one the pixels that contains a Graphics class and know his color? And I can replace these color to other different?
Thanks.
|
|
|
|
|
Yes, Bitmap.GetPixel/SetPixel methods.
Best,
Jun
|
|
|
|
|
But how I can convert the Graphics class into a Bitmap class?
|
|
|
|
|
A graphic doesn't contain any pixel information per se. It's a Brush , Image or Bitmap that holds some pixels
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Yes, I need to replace the white pixel that appears in a Graphics class of a Print event, and I can´t create a Bitmap class.
|
|
|
|
|
This is what I see could be done:
1) Create and maintain a Bitmap object as the drawing buffer (canvas)
2) Construct a Graphics object from the Bitmap (optional)
3) Use that Graphics object to draw to the Bitmap (optional)
4) Change the colors of pixels to the Bitmap
5) Finally, use the Graphics object from the PaintEventArgs to draw the Bitmap to the screen
Hope this helps.
Best,
Jun
|
|
|
|
|
If you have a Bitmap-Object, then you can use GetPixel() and SetPixel() .
But both are very slow if you plan to use it on many pixels.
Use LockBits() and UnlockBits instead.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
please go through articles posted by
'Andrew Kirillov'
they cover a whole lot of the things
|
|
|
|
|
Hi guys,
I need some help please, I have a treeview with menu items where one of them opens an add form and allows the user to select a name. Once the name is selected and saved into the database, I would like to update/refresh the tree with the new node automatically on save.
Please help!
sasa
|
|
|
|
|
SASA_1 wrote: I would like to update/refresh the tree with the new node automatically on save.
You mean when your app starts it should restore the treeview?
You could additionaly save your username like that: users/admins/tony (depends on your structure of course)
You can then recursively call Node.Expand to restore your tree view.
Here's some sample code from a project I work on:
private void ExpandTree(string path)
{
path = path.Replace(@"\\", @"\");
string[] paths = path.Split('\\');
if (paths.Length > 0)
{
TreeNodeCollection currentNodePath = this.trTreeView.Nodes;
TreeNode currentNode = currentNodePath[0];
for (int i = 0; i < paths.Length; i++)
{
foreach (TreeNode node in currentNodePath)
{
if (node.Text.ToLower() == paths[i].ToLower())
{
node.Expand();
currentNodePath = node.Nodes;
currentNode = node;
break;
}
}
}
}
}
You might need to modify it for you needs, though.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank you for your suggestion but, my app does restore the treeview when I restart the app, I just want it to restore the treeview on every node added after it is started.
sasa
|
|
|
|
|
Hello
I don't seem to fully understand your problem. how do you populate your TreeView? I usually make a RefreshTree() that populates my TreeView, and call it each time a change happens. So refresh your TreeView just in the same manner you populate it the first time!!
Again I think I'm not aware of your true problem. Please post me more details on how you populate you TreeView, and if there is any Databinding involoved, or do you explicitly populate you TreeView from a DataSource without binding.
Regards
|
|
|
|
|
How do you compile to a library in C#. or how can i bring a DLL into the final exe so I don't have to install the dll.
I have classes that i use often and don't like just copying the .cs into my project. I'd like a library to link from but don't know how to make it.
Thanks
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|