|
I have a specialized legacy application that was written for XP using VS2003 and .NET 2.0. There are only 2 users of this app, and it's worked great up until they got a new laptop with Vista (and sometime in the past year they've moved out of state, so I'm having to troubleshoot this via email).
What the program does is creates an RTF document (report) and saves it in a subdirectory of where the program currently is, and then prompts whether or not they want to view it. If they do, I use: Process::Start(filename); which has previously opened the document in the default viewer (MS Word). There is no user interaction in creating the filename, and the program checks that it's a valid string.
Here's the exception text I get:
System.ComponentModel.Win32Exception: The system cannot find the file specified
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName)
at LoanServicing.edit_payment.b_reconciliation_Click(Object sender, EventArgs e)
I had the user check to make sure the file was getting created and named correctly, and it is; they can open it by doubleclicking the file icon.
The MSDN documentation seems to indicate that this use should work:
(from the C# example at: http://msdn2.microsoft.com/en-us/library/sxf2saat.aspx)
// The following call to Start succeeds.
Process.Start(path + "Text.txt");
Running the program as Administrator gives the same exception. Any idea what might be the problem here? I've tried everything I can think of...
Thanks!
|
|
|
|
|
You should be keeping track of the full path of the file your writing. If it's in the Program Files folder you can get the path to that with Application.StartupPath . It's always good practice to use fully qualified path names whenever you're working with files. Never assume you know what the "current directory" is going to be at any time.
|
|
|
|
|
This whole mess started out with a conversion from PHP to C#. In the PHP code, PHP's internal OpenSSL module works fine when verifying the signature. However, when using external OpenSSL binaries to perform the same function, neither the PHP code nor the C# code verifies the signature.
Due to that particular problem, I started looking around to see if I could verify an SSL signature via .Net. I have the data to verify with (as a string), the public key (in a file), and the signature (in a file). I've looked for more than a week on Google trying to find something less vague than "look up the signature formatter" (something someone here said). None of the stuff I've found to date makes any sense and assumes I'm already familiar with the crypto stuff in .Net.
All I need is to know if the signature is valid.
I assume that the signatures generated by openSSL code are the same as would be generated by SSL, and SHA1 is the same everywhere, so I should be able to verify this signature with what the three items I have, and I should be able to do it in .Net 2.0.
Can someone PLEASE give me a solid direction to follow so that I don't have to start converting openssl to C#?
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Can someone PLEASE give me a solid direction to follow
John SSL in IIS is very simple. Perhaps you can separate the SSL from the Authentication aspect of your system, is that possible?
|
|
|
|
|
You have to:
- Hash the data you have using the appropriate hash algorithm (SHA1 and MD5 are supported);
- Decrypt the signature using the public key;
- Compare the hashes.
If they are identical you have proved that the message can only have been signed by the corresponding private key, and therefore (presumably) by the owner of the certificate, and that the message has not changed in transit.
Any transformations whatsoever to the data will change the hash value, so you must ensure that only the part of the data that was used to generate the signature is hashed, and you must ensure that you treat it as a simple, opaque array of bytes. You mustn't convert it to a string as .NET's strings are Unicode (UTF-16 little-endian) - if the data was originally UTF-8 or another byte-oriented character set.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Well, I finally got the openssl.exe utility to respond with something ("Verification Failure"), but I'll give what you said a shot.
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
Everytime I've integrate an external DLL in my application, the default config settings of this DLL are used then.
Now I got the problem, that I don't want to compile the whole file when I have to change the database connection.
After hours of google search I found an example how to overwrite the default settings (see below).
It works great, but not for connection strings, it's only good for normal application settings.
I've experimented a little bit with this sample trying to get it work with connection strings, but with no result.
Does anybody know how I could get this work with connection string?
Thank in advance
regards pdluke
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="WindowsApplication1.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="ClassLibrary1.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<WindowsApplication1.Properties.Settings>
<setting name="Setting" serializeAs="String">
<value>abc</value>
</setting>
</WindowsApplication1.Properties.Settings>
<ClassLibrary1.Properties.Settings>
<setting name="Setting" serializeAs="String">
<value>zzzz</value>
</setting>
</ClassLibrary1.Properties.Settings>
</applicationSettings>
</configuration>
|
|
|
|
|
Yesterday i've received an interesting "feature"(or bug?).
My form has context menu (ContextMenuStrip) with two levels:
menuItem_1
-> menuItem_1_1
-> menuItem_1_2
menuItem_2
every menu item has Click event handler:
<br />
void MenuItem_Click(object sender, EventArgs e)<br />
{<br />
ToolStripMenuItem item = (ToolStripMenuItem)sender;<br />
ContextMenuStrip menu = item.Owner as ContextMenuStrip;<br />
MessageBox.Show(menu == null ? "false" : "true");<br />
}<br />
I've got:
menuItem_1 click => true
menuItem_1_1 click => false
menuItem_1_2 click => false
menuItem_2 click => true
So, ToolStripMenuItem's Owner on 2+ level is not a ContextMenuStrip!!! Is it normal? I bet - not...
And how I can receive the reference to the ContextMenuStrip to which the 2+ level menu item belongs?
|
|
|
|
|
First you should check (in the debugger or by calling GetType()) what type the item.Owner actually is. I have a feeling for the submenus it would probably be ToolStripDropDown, not ContextMenuStrip. If you're looking to get a ref to the parent ContextMenuStrip, you might have to do something like ToolStripDropDown.OwnerItem.Owner.
Logan
{o,o}.oO( Did somebody say “mouse”? )
|)””’)
-”-”-
|
|
|
|
|
Yes... item.Owner isn't ContextMenuStrip - it's type is ToolStripDropDownMenu.
Construction like item.OwnerItem.Owner is not comprehensible, because:
1) It works for 2 level menu only, not for 3+
2) For first level it throws exception
Certainly, it is possible to use construction like:
<br />
ToolStripItem parent = item;<br />
while(parent.OwnerItem != null)<br />
parent = parent.OwnerItem;<br />
ContextMenuStrip menu = (ContextMenuStrip)parent.Owner;<br />
... but it looks not as it would be desirable.
P.S. What for the reference to object which property item.Owner (on 2+ level) refers is necessary to me?
|
|
|
|
|
I used nant to build ASP .NET application my VS 2005 .sln file
is being compiled using nant builder ..I heard that nant is used to compile and deploy the ASP .NET application ......
Can anyone plese tell me how to deploy ASP .NET application using nant. I have compiled file ready i want to know how to deploy it...
I m using VS 2005 and Nant-0.85
aaa
|
|
|
|
|
Have you resolved this?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
sry, i know this is prob in the wrong place but hopefully someone can help with my question...
i want to know if there is a javascript code that can be executed in internet explorer to make the send message form load on a page, then link the page
|
|
|
|
|
|
You're right. This is the wrong forum. Plus, you have to be more patient. Waiting only 20 minutes for an answer before posting about it again is pretty bad form. Now - post this on the web forum, and post the message so that it actually makes sense. I didn't have a clue what you were trying to do.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
My question about ado disconnect mode
I wanna used SQL Statement (INSERT INTO,UPDATE,DELETE,SELECT) with ADO Disconnect Mode
Who can I do it?
Thanks
|
|
|
|
|
If you are using SQL Server, you can use the SqlDataAdapter[^] class. Set the InsertCommand and DeleteCommand properties and then call the Update method to update your database.
Paul Marfleet
|
|
|
|
|
Hi. I'm writing an RSS reader and have just discovered it doesn't work with international characters. I'm handling UTF-8 just fine and can handle extended "special" characters, like accents and so on, but for some reason I cannot draw Chinese characters.
Here's the low-down:
I set a breakpoint to check the internal value of a string, which, when I view it using the VS2005 string viewer, shows the proper Chinese characters. However when I draw this to the screen using DrawString (in font Tahoma 8.25f), I get boxes. I also get boxes if I pass the string to MessageBox.Show().
What do I need to do to draw these characters properly?? As I said they ARE there when I view the string inside VS... ??
Logan
{o,o}
|)””’)
-”-”-
|
|
|
|
|
In case you installed the Asian font support for this test and skipped rebooting because you could see the ofnts where already working (in VS for example), the it is time to reboot.
As far as I remmeber Tahoma should work just fine with Chinese, but you can always try some other fonts as the square is typically an indicator of a font problem (if you get a lot of question marks or strange character sequences then it is typically an encoding problem).
|
|
|
|
|
Is Asian font support an option while installing Windows? I don't remember if I installed that or not, but if I can see the characters properly in VS doesn't that imply that I do have that installed?
It seems the only font that works to display the characters is "SimSun", which is clearly a special Chinese font.
Are these characters not supported by standard fonts?? That's a shame if it is so because I did not account for that in my design and I don't want to leave my eastern friends out.
{o,o}
|)””’)
-”-”-
|
|
|
|
|
Yes, you can add them while installing - or anytime later.
Wikipedia[^]
Standard fonts should support Chinese etc once you have installed the Asian fonts.
|
|
|
|
|
Well I can see those fonts properly so it must be installed. However I still get only boxes when I use the regular Graphics.DrawString() with any font other than SimSun.
Perhaps it is a string encoding problem.
{o,o}
|)””’)
-”-”-
|
|
|
|
|
If it was an encoding problem SimSum should not work either.
Copy pasting the Chinese text from the wikipedia site into Notepad I have no problem displaying it with Tahoma - so the font should support it.
|
|
|
|
|
Ah, but I think Wordpad (I'm sure you mean Wordpad) is specially programmed to interpret Chinese characters on a character by character basis, dynamically changing the font (internally) to display it appropriately.
Because... if you copy and paste the text from Wiki into a label control on a WinForm (even just in designer mode), you get boxes.
I've managed a last-minute workaround by implementing a "Chinese character mode" in my program which simply changes all of the necessary fonts to SimSun. Until I find a proper solution (maybe WPF will be better when I migrate to it) this will at least enable east-Asian users to use my program.
{o,o}.oO(i need something funny to say--any ideas?)
|)””’)
-”-”-
|
|
|
|
|
I mean Notepad
Neither my Vista nor Windows 2003 systems have problem displaying the Chinese text in Notepad using the Tahoma font. If your system can't do it, then your font install is messed up.
|
|
|
|