|
Hi there...
I´m facing a strange problem... I made a WebApp which serializate a complex object and save in the bank and load to save time of processor. When the WebApp save and read the object everything goes fine, but If I install one second WebApp in other server the same object is readed but the HashCode is differently from the original...
Anyone has a opnion about that??
Thanks in advance...
|
|
|
|
|
This is strange.
You should try to compare and see if they are the same (time stamps and everything)
If you can not find anything override the default Objectt.GetHashcode function and write your own. If you have an id for the object just use return id.GetHashCode(); in the override.
Natza Mitzi
|
|
|
|
|
Natza Mitzi wrote: This is strange.
It is not strange, it's perfect normal behaviour. I suggest you read about the topic a bit more. It has 'bitten' me a few times
|
|
|
|
|
You are correct.
Natza Mitzi
|
|
|
|
|
I suppose this is normal behaviour. There are no guarantees that the hash code is the same when retrieved for an object nor that it is unique. If you want to predict the value of the hashcode (for example that it stays the same), you must build your own implementation.
From BOL:
The default implementation of the GetHashCode method does not guarantee unique return values for different objects. Furthermore, the .NET Framework does not guarantee the default implementation of the GetHashCode method, and the value it returns will be the same between different versions of the .NET Framework. Consequently, the default implementation of this method must not be used as a unique object identifier for hashing purposes.
|
|
|
|
|
You need to override GetHashCode() and provide your own consistent behaviour.
|
|
|
|
|
Hi,
How to print the entire information on a windows form.
I am using MS- .NET 2005
Thanks In Advance
Regards,
Puneet
|
|
|
|
|
Congratulations: You are the winner of the vaguest question of the day!
What information?
|
|
|
|
|
|
Hello Puneet,
Take a look at the following web link. I believe this should help.
http://www.csharpcorner.com/UploadFile/srajlaxmi/PrintingWindowsForm01182008021239AM/PrintingWindowsForm.aspx
Regards,
Allen
Allen Smith
ComponentOne LLC
www.componentone.com
|
|
|
|
|
There is an article on this site about a component that should do the trick for you. Do a search for it and you'll find it
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hello,
VS 2008 running on Windows XP.
I am trying to publish my application using clickonce on to a remote server which is running Windows server 2003 Enterprize edition.
Failed to connect to 'http://10.10.10.8/CATDialer/' with the following error: Unable to create the Web site 'http://10.10.10.8/CATDialer/'. The Web server does not appear to have FrontPage Server Extensions installed.
I have installed FrontPage Server extensions without any problems. However, the problem remains.
I am not sure but is this because of some security issues that have not been set correctly or a configuration on the IIS.
I have browsed google, but cannot find any solution to this problem.
Many thanks for any suggestions,
|
|
|
|
|
did you ever solve this issue? we actually ran into the same damned behavior and spent hours finding the bug ..
Christian
|
|
|
|
|
The simplest solution I can offer you, is to publish to your own File System, then manually copying the files produced to your production System.
*REMEMBER* to have the correct URL in the "Installation Folder URL" box when publishing, this should be the folder you wanted to publish to in the first place.
|
|
|
|
|
Hi,
How can I send two keyboard keys at the same time by using System32?
I can send consecutively but I need at the same time. For example Ctrl+c
Ctrl must be keydown, C must be keyup.(key combination for copy)
Best Regards
|
|
|
|
|
And SendKeys did not work how for you?
|
|
|
|
|
No, it didn't solve my problem. I tried.
|
|
|
|
|
|
Keyboard api works always although the form is inactive. SendKey method is not working on Button Click. I need system32.
|
|
|
|
|
Sorry, cant help there
|
|
|
|
|
You have two choices I think.
1. SendKeys CP Article here[^]
2. SendMessage from user32.dll PInvoke.net[^]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Hello all experts,
I am currenting doing my final year project about Windows mobile devices. I have the following code:
if (((Button)sender).Text == "Start")
{
try
{
//---connect to the server---
client = new TcpClient();
client.Connect(server_IP, PORTNO);
data = new byte[client.ReceiveBufferSize];
//---send message---
SendMessage("Send");
//---begin reading data asynchronously from the server---
t = new System.Threading.Thread(ReceiveImageLoop);
t.Start();
MessageBox.Show("threat created");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
MessageBox.Show("error !");
}
}
If I compile this code using Windows XP SP2, it is working fine. However, as I paste the code onto WM6, I got the following error message :
"
A first chance exception of type 'System.IO.IOException' occurred in mscorlib.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
"
I see that my windows mobile device could not initiate a TCP connection. Could anyone give me some hints ?
Wholeheartly thanks !
|
|
|
|
|
A first chance exception is a caught exception. Please post the final exception causing that is causing your error.
|
|
|
|
|
Hi Leppie,
Just wonder what do you mean by final excpetion. Sorry I am a newbie to C#. Please further help by providing me some guidance to get to the final excpetion.
Once again, thank you for your help !
--Leslie
|
|
|
|
|
The one that made your program stop.
|
|
|
|