|
Christian Graus wrote: Sleep(1) sleeps for a microsecond, 1/1000 of a second
1/1000 of a second is one millisecond. A microsecond is one millionth of a second I believe.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Oh, whatever. I doubt it would make much difference.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi All;;;
I want To make textbox accept only character and not number,
(Active only character key ,backspace key, and apace key)
and disactive all other keys.
please help me,,,
thanks all
|
|
|
|
|
|
Try this code:
private void textBox1_KeyDown(object sender, KeyEventArgs e) {
if (e.KeyValue >= 48 && e.KeyValue <= 57)
e.SuppressKeyPress = true;
}
Regards,
Lev
|
|
|
|
|
I wrote this code it is close to what you are trying to do.
I am not a C# programmer however so here it is in VB.NET
''' <summary>
''' This routine will not let the user enter anything except numbers and dashes into the SSN textbox
''' </summary>
''' <param name="e">This is the Keypressevent from the calling form</param>
''' <remarks></remarks>
Public Sub sSocialKeyPress(ByVal e As System.Windows.Forms.KeyPressEventArgs)
' allow backspace
If Asc(e.KeyChar) = 8 Then
Exit Sub
End If
'Dont catch control
If Char.IsControl(e.KeyChar) Then
Exit Sub
End If
'numbers Only
If Char.IsNumber(e.KeyChar) Then
e.Handled = False ' and cancel this keystroke
Else
e.Handled = True
End If
End Sub
Private Sub txtSocialSecurityNumber_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtSocialSecurityNumber.KeyPress
sSocialKeyPress(e)
End Sub
Use the C# equivalent of this for the text box you are wanting to validate.
I hope this helps, BTW I know I am not the best programmer so please noone laugh very hard. LOL
Humble Programmer
|
|
|
|
|
I wrote an article[^] that does exactly the reverse - only numeric. It's not difficult to adapt it. There are a couple of comments at the bottom of the article on other approaches that you might find usefult too.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
string[] arFiles = Directory.GetFiles(System.Environment.GetFolderPath(System.Environment.SpecialFolder.InternetCache));
int x = 0;
foreach (string f in arFiles)
MessageBox.Show(arFiles[x]);
The above code will only get "desktop.ini", I'm not surprised though, I know this's a special folder but do you have an idea how to reach a specific file and read it's content in this folder??
Thank you guys!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Muammar© wrote: int x = 0;
foreach (string f in arFiles)
MessageBox.Show(arFiles[x]);
Huh? what is the purpose of f in the above snippet?
|
|
|
|
|
Okay okay I was so sleepy when I wrote this, I got it now, thanks Luc
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Muammar© wrote: foreach (string f in arFiles) MessageBox.Show(arFiles[x]);
What the ...??
How about looking at the file names and not the first element of an array over and over again.
foreach (string f in arFiles)
Debug.WriteLine(f);
|
|
|
|
|
Yes, I guess we shouldn't code after midnight. Thanks Dave!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi,
The files are located in several subdirectories and something like this will find them for you.
private void FindFiles() {
String[] files = Directory.GetFiles(
System.Environment.GetFolderPath(
System.Environment.SpecialFolder.InternetCache),
"*.*",
SearchOption.AllDirectories);
foreach (String file in files) {
Console.WriteLine(file);
}
}
Alan.
|
|
|
|
|
Thanks Alan, that does it!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi,
The wsdl web service is behind proxy. I can access the wsdl with the iexplorer but I cannot access the web service with C# client which works fine when the client is on the same machine as the service or the service is not behind proxi. I tried using wsdl utility with /proxy but it generated the same stub as without this option.
What do I do?
Thanks.
|
|
|
|
|
Hi All,
I have worked on Windows Apps before and deployed them easily because there were no local DB, however this time I need to deploy a Winform [C#] application along with the SQL Server DB which contains several tables and stored procs.
The query is
1) How to deal all deployment issues using Setup project only?
Regards
Grk
|
|
|
|
|
i have a wireless router and i want to restart it from my app. any idea ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hmm, the only thing that comes to my mind... You definitely have a web-interface on the router, with a restart button, you can try to see what's the request it sends (sniff?) and send it yourself, you will need to authorize first, of course
Regards,
Lev
|
|
|
|
|
Hmmm, you were faster, dang...
|
|
|
|
|
But you beat me.
Simon
|
|
|
|
|
i had another idea by using these Functions
[DllImport("user32.dll")]
public static extern bool SetCursorPos(int X, int Y);
[DllImport("user32.dll")]
public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);
[DllImport("user32.dll")]
public static extern IntPtr keybd_event(int key, int dummy, int flags, IntPtr info);
hope you got me, but i dont like that way
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
That seems to complicated. You should give the idea with the web interface a try.
|
|
|
|
|
im not too good in that web thing...this is complicated than that
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Don't like that idea either, this is very error prone
Regards,
Lev
|
|
|
|
|
Hi,
I guess your router has a web frontend to manage. There will be a site/button to reset the router. Maybe you could send a HTTP request to the router, simulating that a user pushes the button.
Regards
Sebastian
|
|
|
|