|
The type or namespace name 'MD5CryptoServiceProvider' could not be found (are you missing a using directive or an assembly reference?) .
The above exception coming for WindowsMobile, Visual Studio 2005 application, when we tried to use MD5 hashing function, already added
using System.Security.Cryptography.
please advice..
|
|
|
|
|
The cryptography APIs follow a factory pattern. If you want an instance of the MD5 algorithm, use System.Security.Cryptography.MD5.Create .
The MD5 algorithm is supported as of .NET Compact Framework 2.0.
|
|
|
|
|
thanks mike.
But the intellisense is not showing System.Security.Cryptography.MD5
its only showing untill System.Security.Cryptography!
Am I missing any reference?
|
|
|
|
|
I think your project must still be set for Compact Framework 1.0, which did not have this class. Check whether your target device will be compatible - Compact Framework 2.0 works with Windows Mobile 2003 for Pocket PC, Windows Mobile 5.0, custom CE 5.0 platforms, and SP1 adds support for custom CE 4.2 platforms. If so, consider upgrading the project using the Project, Upgrade Project menu option.
If you must keep using Compact Framework 1.0, consider using the MD5 class from OpenNETCF v1.4[^].
|
|
|
|
|
Hello Everybody,
I have already asked this question but no body given me response, i am repeating the same problme:-
I have made a user control, then add a panel on it and add a combobox on the panel. The whole user control then i added at runtime to a Autocad Pallete. But when i want to select an item from the combobox it hides the menu. But i am able to select the item from keybord. What is the problem with mouse?
Thanks...
|
|
|
|
|
Hi all.
I'm busy with the exception handling on my project. What I'm looking for is documentation on exception handling. Something that will tell me that when working with sql catch the following excptions and when working with int catch the following exceptions. I want to be able to break it down as simple as possible. I found the basic exception and their bases...But I want more....
Thanks in advance and any help will be much appreciated
He who laughs last is a bit on the slow side
|
|
|
|
|
hi,
I suggest you to try MS's Enterprise Library Application Block, an Exception
Handling Application block may meet your needs.
peiking
|
|
|
|
|
Look at the framework documentation for the methods you are calling - it will list exceptions thrown. Now catch those you can FIX. Never ever catch something you can't actually fix (with ot without user interaction).
Basically the rule of exception handling is not "I want more". It is "I want less".
|
|
|
|
|
Thanks. Where do I find the framework documentation??
The reason why I want to catch as many exceptions as possible is that want I want to do is write all the exceptions thrown to an eventlog I'm still in the process of figuring out (next obstical)
From there we want to be able to just retrieve the custom eventlog and then from there be able to get information on the exceptions.
Many thanx
He who laughs last is a bit on the slow side
|
|
|
|
|
The documentation is on MSDN - if you have a license you can install it localy - if not you can browse it online (msdn.microsoft.com). If I need it online I normally find it by searching on the class name / method name with Google, so I have no idea how to navigate to it.
No need to plaster your code full of try catch statements just to log the exception.
Take a look at: AppDomain.CurrentDomain.UnhandledException
Make sure you read the documentation - as there are some alternatives to this event that might be needed in your code.
Again - Handle as late as possible - the golden rule with Exception handling.
Also take a look at the exception handling enterprise block mentioned in an earlier post (along with the logging enterprise block I guess). You are not the first on the planet wanting to log errors, so the code is probably already written.
|
|
|
|
|
Hello all
i want to give desktop alerts using .NET 1.1.
Anybody help me in this
awaiting for reply
|
|
|
|
|
There are various articles on CP which outline how to do this.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Hi,
Can someone please tell me if string.Empty is exactly the same as ""?
If I do these 2 tests, will it be exactly the same?
if (strFName == "")
{
}
if (strFName = string.Empty)
{
}
Regards,
ma se
|
|
|
|
|
From MSDN:
String.Empty Field
Remarks
The value of this field is the zero-length string, "".
|
|
|
|
|
ma se wrote: if (strFName = string.Empty)
{
}
I assume you meant
if (strFName == string.Empty)
{
} Yes, they are the same. As an aside, if you're using .NET 2.0, you can use IsNullOrEmpty[^] instead. That way, you don't have to check for null before checking for the empty string.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Yes I meant ==.
Thanks for the help, I actually forgot about IsNullOrEmpty.
Cheers.
|
|
|
|
|
You may also want to consider "String.Length == 0", this is the optimised one according to Nick's test, please read this:
http://www.dotnet247.com/247reference/msgs/23/118322.aspx
Regards.
modified 17-Jul-19 21:02pm.
|
|
|
|
|
|
I need to create a application process in my windows service,but I can't see the GUI of the application. The code to create the application process worked well in one of my console project.Can any one tell me why? Is it possible to create a application process in windows service?
Thank you!!!
|
|
|
|
|
You cannot see the GUI of service. You can create a process in service, but you must find another way to create it. Probably you can using event or something like that. For example :
If my service is started, then create a new process.
|
|
|
|
|
I don't need to see the GUI of service. What I want to see is the GUI of the process created by my windows service.For example:
I send a message to my service and my service should open a .txt file by notepad. What I want to see is the GUI of notepad,so I can edit the file. But I can the notepad process in the task manager instead of the GUI of it on the screen.
So, could you tell me if I want to see the GUI of notepad in this case, what should I do?
Thank you!
|
|
|
|
|
In my project, I have created custom text box deriving it from text box control. I would like to select the text present when focus is received in the custom text box. Focus can be received in custom control either pressing tab or clicking into the textbox control. In my custom control I have overridden the getfocus behaviour and placed following code :
protected override void OnGotFocus(EventArgs e)
{
if (!ReadOnly)
{
BackColor = _backHighLightColor; // just to change back color
// to selected complete text in the textbox when focus received
SelectAll();
}
}
With above line of code, text in the custom textbox control gets selected when I'm getting the foucs into the control using the tab but doesn't select the text when i click into the custom text box.
I could write the above code in the click event of custom control by overriding the base implementation for click but i don't want to do that as click event of my custom control is intended to do some other functionality as well.
Can anyone help me with this?
regards,
KC
|
|
|
|
|
Hi, KC.
KrunalC wrote: I have overridden the getfocus behaviour
It's better to override OnEnter() method because you have a side effect with your code in OnGotFocus() (1. enter some text into your textbox; 2. go to an another form 3; go back to your form. After this your text will be fully selected. It's not a correct behaviour (although IE uses it in the address bar)).
KrunalC wrote: I could write the above code in the click event of custom control by overriding the base implementation for click but i don't want to do that
I think you have to do that. But override OnMouseDown() instead of OnClick(). It will be more common behaviour. And you'll have to add some logic there to prevent selection when control already has focus.
|
|
|
|
|
Andrew,
Thanks for your reply.
I have gone through your reply but I'm afraid it will not serve the purpose for me. I got your argument on why I should override OnEnter() rather than OnGotFocus(). But still I will have to override the Click or Mousedown. Basically I want to avoid this. Also I would like to know why such behaviour is there. Why focus i received by clicking the control not giving the expected behaviour as got foucs.
I would appreciate if someone can explain me the behaviour i.e. what is the difference when focus is received by pressing the tab key or when focus is received by clicking into the control.
Thanks,
KC
|
|
|
|
|
I think the difference between tab-focus and mouseclick-focus is:
1. When control receives focus by pressing tab the only one action occurs -- receiving focus. At this moment you select all the text and cursor automatically goes to the end of the text.
2. When control receives focus by clicking into the control there are two actions: At first you have behaviour as described at 1. But then control must move cursor to the position where you clicked within the control. And this movement clears the selection. (It looks like you select control with tab and then press arrow key to move cursor within the control.)
I don't think you can prevent this behaviour for the common winform textbox without overriding mouse events.
|
|
|
|