|
Hello!!
Can I get the original string from a HashCode?
I mean, do the reverse action of GetHashCode.
thanks
Scan files and folders for viruses from your .Net applications - Click here!
|
|
|
|
|
I don't think that's possible. The hash code simply could not be unique enough to support all possible strings.
If you want to store string and hash code pairs, use a System.Collections.Generic.Dictionary<int, string> to store them together. You can then easily retrieve strings via dictionary[hashCode].
|
|
|
|
|
It's totally not possible. The hashing function is always one way.
Since int can only have about 2.2B possible values, there is way more than 2.2B possible string combinations.
|
|
|
|
|
|
No, it's not possible.
Just image if it was... You could put any data into a string and compress it to 32 bits. There would be no need for fast internet connections or large hard drives...
---
b { font-weight: normal; }
|
|
|
|
|
Hi all,
I tried develope my own version of the "Hooking Keyboard from IE".But the CBT hook proc is not working as expected.It is not informing abt the IE activation by setting the flag value.Only window creation is getting known. I am adding that code alone here. Please tell me where am i wrong in this.
public static int CbtHookProc(int nCode, IntPtr wParam,IntPtr lParam)
{
StringBuilder title = new StringBuilder();
string classname;
title.Capacity=10;
if(nCode==HCBT_ACTIVATE)
{
try{
GetClassName(wParam,title,10);
classname=title.ToString();
if(classname.StartsWith("IE"))
IE_Active=true;
else
IE_Active=false;
}
catch(Exception e)
{
MessageBox.Show(e.ToString());
}
}
return CallNextHookEx(CBTHook,nCode,wParam,lParam);
}
Please help me.
Thanks and regards,
LMHP
|
|
|
|
|
Hi all,
I tried develope my own version of the "Hooking Keyboard from IE".But the CBT hook proc is not working as expected.It is not informing abt the IE activation by setting the flag value.Only window creation is getting known. I am adding that code alone here. Please tell me where am i wrong in this.
public static int CbtHookProc(int nCode, IntPtr wParam,IntPtr lParam)
{
StringBuilder title = new StringBuilder();
string classname;
title.Capacity=10;
if(nCode==HCBT_ACTIVATE)
{
try{
GetClassName(wParam,title,10);
classname=title.ToString();
if(classname.StartsWith("IE"))
IE_Active=true;
else
IE_Active=false;
}
catch(Exception e)
{
MessageBox.Show(e.ToString());
}
}
return CallNextHookEx(CBTHook,nCode,wParam,lParam);
}
Please help me.
Thanks and regards,
LMHP
|
|
|
|
|
Hello
I done one grid view into this grid view i have one colum with dropdownlis but i don't know how get the var from this dropdownlist to my update function pleas help me.
good bye
best regards
|
|
|
|
|
Are you looking how to get selected value of dropdownlist?
Can you share your piece of code here, to see what is going on?
|
|
|
|
|
yes
<asp:templatefield headertext="Marks">
<itemtemplate>
<asp:dropdownlist datasource="<%#PopulateControls()%>" datatextfield="marks"
="" datavaluefield="marks" id="Ddl1" runat="server" backcolor="#FFFFC0" forecolor="MediumBlue">
c# code
public DataSet PopulateControls()
{
SqlConnection myConnection = new SqlConnection("Persist Security Info=False;Trusted_Connection=True;database=printer_order;server=(local)");
SqlDataAdapter ad = new SqlDataAdapter("SELECT [name_mark] as[marks] FROM printer_mark ",
myConnection);
DataSet ds = new DataSet();
ad.Fill(ds);
return ds;
}
-- modified at 10:49 Monday 10th April, 2006
|
|
|
|
|
The main problem is becaus i don't know what to give to @marks like parameter in create update down is a code for update command/
begin transaction
select @id_mark=id_mark from printer_mark where name_mark=@marks
if @@rowcount<>1 begin
rollback transaction
return
end
update printer_type
set name_type=@name_type,black_cartridge=@black_cartridge,color_cartridge=@color_cartridge,
discription=@discription,note=@note, id_mark=@id_mark where id_type=@id_type
if @@rowcount<>1 begin
rollback transaction
return
end
commit transaction
in all time is give me same error what to do?
Must declare the variable '@marks'.
-- modified at 10:39 Monday 10th April, 2006
|
|
|
|
|
i know to handle WinPrc() funzion, but how?
|
|
|
|
|
Derive a class from System.Windows.Forms.Form, and override the WndProc method.
As a side note, it's not a good idea to do custom drawing on the title bar. The title bar is maintained by the OS; in new versions of Windows, your app may not port well. In fact, Vista migration guidlines specifically mention that drawing on the title bar will be corrupted in Vista since the window manager composites how the title bar is blended with the background (as windows are translucent in Vista).
|
|
|
|
|
so what do you suggest me to do?
|
|
|
|
|
In regards to the WndProc or the titlebar drawing?
|
|
|
|
|
I am developing GUI of my Project in C# for easness and core functionallity is implemented in C++ (UN Managed).
So, I write a wrapper class in Managed C++ which handles all Marshalling-Un Marshalling issues as well as calling unmanaged C++ class.
The problem is that the wrapper class is compiled properly but when i call this wrapper class which is Managed DLL i got an exception System.IO.FileNotFoundException at dll loading time. so catch block can not handle it and exception is thrown directly.
Please help me in this regards
Zeeshan
|
|
|
|
|
|
I want to increment the size of array at run time and also want to preserve the data already existing in the array
Help me please
|
|
|
|
|
There is no way of changing the size of an array. You have to create a new array of the desired size and copy the contents of the old array to the new.
Perhaps you want to use a list or dictionary instead of an array.
---
b { font-weight: normal; }
|
|
|
|
|
We use redim in vb.net is not there any redim like function in C#.
Thanks
|
|
|
|
|
No, there isn't any ReDim in C# or in the .NET framework.
The ReDim command in VB.NET just does what I described. It probably exists mostly for historical reasons, and I suggest that you don't use it at all. Leave the ancient commands behind and use what's in the framework.
---
b { font-weight: normal; }
|
|
|
|
|
|
There is a Collection Class called ArrayList. There are three methods: (Add, Insert, Remove). You can find this code example in Visual C# .NET Step by Step.
Quick Example:
ArrayList numbers = new ArrayList();
//fill the arrayList
foreach (int number in new int[12}{10,9,8,7,7,6,5,4,3,2,1})
{
numbers.Add(number);
}
//Remove first element whose value is 7 (the fourth (4th) index 3)
numbers.Remove(7);
//Now remove the element that's now the 7th element. index: 6 (10)
numbers.RemoveAt(6);
Hope this helps. . .
Tom Johnson
A+, MCP MCSD .NET SQL
|
|
|
|
|
Hi.
I have VS 2003 on my computer and I am wondering if I can install VS 2005 also on my computer without uninstalling 2003. Can I have both VS 2003 and VS 2005 on my computer at the same time?
Thanks,
F
F
|
|
|
|
|