|
never.reply wrote: what the best HASH Encryption
"Hashes aren't encryption"
link[^]
|
|
|
|
|
Perhaps they want to make a hash, and then encrypt it
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
.NET offers MD5, RIPEMD160, SHA1, SHA256, SHA384, and SHA512.
I can't tell which is right for you without know why you need a hash function.
SHA512 is the most "secure" of the choices but it maybe overkill in certain applications.
|
|
|
|
|
Hi everyone...
I'm working with some Touch-Kit Touch-Screens and Win-Driver under C#.
The main idea is to work with the Touch-Screen as the expanded Monitor (Secondary).
So a user can work with the PC on the primary screen and another on the secondary.
I built an On-Screen Keyboard and works great.
My problem now is to work with the mouse and the touch separately.
I want the user who is in the main screen to work with the mouse, but the user who is with the touchscreen just touching the screen.
Everything works fine until I tried to touch a menu of an application (eg. File menu on Ultra-Edit).
Which is the way to Send/Post a message to the Target App on (X,Y) Screen position.
I'm doing the following.
My app captures the USB port and reads the Touch-Screen's IN pipe. Calculates the Screen Point with the calibration data and starts the messaging.
- Basically the steps are sum-up to:
1- Capture the hWnd from point (x, y). hWnd = WindowFromPoint( p );
2- ScreenToClient( hWnd, ref p );
3- PostMessge( hWnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG( p ) );
4- PostMessge( hWnd, WM_LBUTTONUP, 0, MAKELONG( p ) );
The reason I'm using PostMessage instead of SendMessage is because, when an application, after touching the screen shows a message box, my app is halted until the message box disapears.
Hope to be clear about what I'm looking to do!
Thanks a lot everyone!
Guillermo L. Odone
|
|
|
|
|
I have Access 2003. I need to write a C# app to import the contents of a (very simple) Access 2000 database. In this database are three tables, linked by primary keys. The keys have the datatype of 'number', but when I look at them in Access 2003, they are GUIDs. I can't work out how to write the SQL to get the records associated with a GUID. Based on some reading, I tried this:
OleDbCommand cmd = Myconnection.CreateCommand();
cmd.CommandText = "SELECT * FROM Records where Key = {GUID {" + clientKey + "}}";
dbReader = cmd.ExecuteReader();
but the reader is always empty. What's the syntax for filtering on a number data type that turns out to be a guid ?
Thanks
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Having knocked up a quick sample app, that syntax should work.
In Access, a GUID is the data type for fields of type AutoNumber with the Field Size property set to 'Replication ID'. Is your GUID formatted correctly?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I don't know. I am reading it in as a string from the database, and then formatting that string to do the query. The data type in the database is 'number', not GUID. The GUID in the database looks exactly like the string I am getting back and storing for my query.
Yes, the field type is 'replication Id'
-- modified at 16:08 Monday 5th November, 2007
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I changed the data type of the field in my sample app to 'Number' and it still worked OK.
This is the query I used:
SELECT * FROM Table1 WHERE xxx = {GUID {5CC9B07E-5DBE-4C65-9B84-7CBE5B6C523B}};
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
OK - I guess I need to play with it some more then. Thanks.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
When not using a parameter...
I find that simply putting a GUID in quotes works
select * from t where id='01aaad5e-d02e-4c39-8fd0-8d7da3fdd5f4'
|
|
|
|
|
Sounds like interesting homework. I'm sure you'll learn a lot writing it. If you get stuck when you've tried to do your own homework ( when you have actual code ), try posting a question here, we'd love to help.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
well its actually an assignment and i only need to know how to start it off with a function so that i can use that guide to help me with the rest of the program
|
|
|
|
|
NickYan wrote: well its actually an assignment
What is the difference between homework and an assignment?
NickYan wrote: i only need to know how to start it off with a function
public string ConvertBase(int sourceBase, int destinationBase, string value)
{
}
|
|
|
|
|
Christian Graus wrote: "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
I think that if that is what the function does then it is a very good name for it.
-- modified at 19:49 Monday 5th November, 2007
Actually, it was interesting to see that people just copy my code without really understanding it. I would like to say that it was a deliberate gotcha, but I wrote the article during a bout of insomnia so I probably wasn't thinking my best.
|
|
|
|
|
i only know how to program a simple code with a function that is simple ...not this complicated thing with strings..etc ....
|
|
|
|
|
::Ahem:: This isn't complicated.
|
|
|
|
|
NickYan wrote: i only know how to program a simple code with a function that is simple ...not this complicated thing with strings..etc ....
Strings are typically covered in the first chapter or two of any introductory text on C#. If you cannot yet handle strings then I'm confused why your tutor is giving you this assignment.
|
|
|
|
|
i got 2 codes separate after trying to do it over and over again:here is the binary to decimal code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/* Function Prototypes */
int bintodec(int fbase, int number);
int main()
{
int number;
int fbase;
int tobase;
int result;
printf("Enter base from: ");
scanf("%d",&fbase);
printf("Enter your number:");
scanf("%d",&number);
printf("Enter base to convert to: ");
scanf("%d",&tobase);
result = bintodec(fbase,number);
printf("The result is:%d", result);
system("PAUSE");
return 0;
}
int bintodec(int fbase, int number)
{
int bin[256];
int counter =0;
int counterR =0;
int quo =1 ;
int result =0;
int result1 =0;
int res[256];
static int sum =0;
while(quo>0)
{
quo= number/10;
bin[counter] = number%10;
number=quo;
counter++;
}
while (counter>0)
{
result = pow(fbase, (counter-1));
result1=result*bin[counter-1];
res[counterR]=result1;
counter--;
counterR++;
}
while (counterR > 0)
{
sum = sum + res[counterR-1];
counterR--;
}
return sum;
}
and the decimal to binary code :
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int tobase=0;
int number =0;
int counter = 0;
int bin [25];
int quo = 1;
printf("Enter your number:");
scanf("%d",&number);
printf("Enter base to convert to: ");
scanf("%d",&tobase);
while (quo!= 0)
{
quo= number/tobase;
bin[counter] = number%tobase;
counter ++;
number=quo;
}
while (counter > 0)
{
printf( "%d", bin[counter-1]);
counter --;
}
system("PAUSE");
return 0;
}
Now i need to know how to get both of these codes into 1 complete source code for bases conversion.and also asking the user to either convert decimal to binary vice-versa ......
this is the furthest i can go so please help me.
|
|
|
|
|
The above code is for C or C++ not C#. Are you sure you are in the right forum?
|
|
|
|
|
it is an ansi c program not c++ .....i think im in the wrong forum my apologies....i dont kno where is the rite forum cause i dont want c++ i want C only
-- modified at 13:33 Tuesday 6th November, 2007
|
|
|
|
|
C++ is the superset of C. If you say you are using C they will be able to help in the C++ forum most likely.
|
|
|
|
|
Hi,
i have a User Control i've created
When a property is changed i like to raise an event
in the Form Hosting The user control
but i also want to pass a value to The Form
i've Done this :
<br />
<br />
public event EventHandler MyVarChanged;<br />
<br />
private void OnChanged(FireEventArgs e) <br />
{<br />
if (MyVarChanged != null)<br />
MyVarChanged(this, e);<br />
}<br />
<br />
and in the Set {} of The property:<br />
if (myVar > 10)<br />
OnChanged(EventArgs.Empty);<br />
in The Form :
<br />
private void userControl11_MyVarChanged(object sender, EventArgs e)<br />
{<br />
}<br />
So Far So Good
but i like to pass a parameter
How Do I continue...
THNKS
Have Fun
Never forget it
|
|
|
|
|
To pass a parameter, don't use EventArgs. Create a new class deriving from EventArgs that contains your information. The call OnChanged(new MySpecialEventArgs(...)) to raise the event and pass parameters to the handlers.
|
|
|
|
|
Yeh i figured that
But Got Stucked
i've created that derived like this :
<br />
public class MyVarChangedEventArgs: EventArgs<br />
{<br />
public bool sState;<br />
<br />
public MyVarChangedEventArgs(bool state) <br />
{<br />
this.sState = state;<br />
}<br />
}<br />
And Changed all other like this :
<br />
if (myVar > 10)<br />
OnChanged(new MyVarChangedEventArgs(true));<br />
public event EventHandler MyVarChanged;<br />
<br />
private void OnChanged(MyVarChangedEventArgs e) <br />
{<br />
if (MyVarChanged != null)<br />
MyVarChanged(this, e);<br />
}<br />
but when i open the
e. in The form i do not see the value
am i missing something
Maybe i did not understood the idea that well
THANK
Have Fun
Never forget it
|
|
|
|
|
You need to either change your event declaration to use your custom EventArgs, like so:
public event EventHandler<MyVarChangedEventArgs> MyVarChanged;
Or you can case the EventArgs in your event handler to your custom EventArgs. Basically, the framework things it's an instance of EventArgs, but actually it's an instance of MyVarChangedEventArgs. The first option is your best bet though.
-- modified at 14:18 Monday 5th November, 2007
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|