|
a.
For the time monitoring you should use the System.Timers.Timer Class.
create a timer object
System.Timers.Timer BtnTimer
and set the interval to 1000 (1 second)
NOW-
use something like flag (BOOL blDuringClick; ) that will determine whether you are during a 'rapid' click time, on the button's click event set blDuringClick = True and use BtnTimer.stop and then BtnTimer.Start (so each click resets the timer), and on the Elapsed event for the timer set blDuringClick = False
now when you handle click events check if you are during the rapid click by checking blDuringClick 's value.
b.
For checking the character,
there are many ways to do it, maybe the easiest one is to have a string for each button holding something like "2ABCabc" and then cycle through the chars (hold an index, and remember to check bounds).
Fade (Amit BS)
|
|
|
|
|
today i installed VS.Net and after that i downloaded some code samples from microsof's site, and when i try to open the sample project, a message comes and says, "Your project file version is '7.10'. Visual Studio .NET can only load version 7.0 project files".
how can i get the higher version ...? is it available like a patch/update..????
I want to change Myself..Can u help me?
|
|
|
|
|
I guess, you are using visual studio version 2002 (7.0 as it says), and the sample files are for the VS.NET version 2003 (7.1).
renjith_sree wrote:
ow can i get the higher version ...? is it available like a patch/update..????
It comes as separate pack of CDs (6), you may have to buy them as separate package
There is nothing new under the sun, But there are lots of old things we don't know. - Ambrose Bierce
|
|
|
|
|
hi, how I convert C++ HANDLE into .net ambient?
I'm importing functions from unrar.dll and It uses a function that returns HANDLE..... thanks in advance
|
|
|
|
|
Use System.IntPtr . Use IntPtr.Zero where you would pass a NULL .
A common pattern is to wrap the HANDLE with a simple wrapper class that implements the IDisposable interface and has a finalizer (the ~ClassName function in C#, or an override of Finalize in VB.NET) which calls Dispose . Inside your override of Dispose you should suppress the finalizer using GC.SuppressFinalize (this allows the object's memory to be freed earlier if Dispose is called explicitly) then call whatever function frees the HANDLE .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I am building an application that will use Microsoft's ODBC .NET Data Provider. That is an extension that is not installed by default with the .NET framework. I would like my application to detect whether the data provider has been installed on the machine where it is running during startup.
How would I go about doing this, any suggestions?
-swc
|
|
|
|
|
Hi!
I searched on Google as well as the entire codeproject forum and still can't find answer to my problem. I am desparetely in need of someone's advice!!
I have ASP.NET C# code to dynamicly create excel file on server. User will then click on a link to the created excel file and download/browse the content.
I need to change this so that the dynamcly created excel file will be directly transffered to the client (without saving it on the server disk!)
Is it possible to do such a sthing?
Here is how I create the excel file on server. fileExcel is the filename of the creating excel file.
<br />
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Driver={Microsoft Excel Driver (*.xls)};DBQ=" + @xlsTemplatePath + "\\" + fileExcel + ";ReadOnly=False;Extended Properties=Excel 8.0;";<br />
OdbcConnection conn= new OdbcConnection();<br />
conn.ConnectionString = connectionString;<br />
conn.Open();<br />
OdbcCommand myOdbcCommand = new OdbcCommand();<br />
myOdbcCommand.Connection = conn; <br />
<br />
myOdbcCommand.CommandText = "CREATE TABLE [Sheet1$] ( " + strColNamesWV + ")";<br />
myOdbcCommand.ExecuteNonQuery();<br />
<br />
... <br />
<br />
I will hugely appriciate if you could shine some light on my mind.
|
|
|
|
|
You cannot do it using that technique. Probably, the only way to do it is using a 3rd party component. Try Aspose.com. I have not tried their Excel component, but their PDF one worked very well - we stream the PDF directly to the browser, no temp file.
|
|
|
|
|
Hello. Is it possible to compile native code of C# application? I mean is it possible to compile code in such a way that applications work without .NET Framework? And how to do this?
My best regards
|
|
|
|
|
No. C# is a managed language. As such, any machine that runs it must have the .NET framework installed.
If you need to compile to machine code, write in a language such as C or C++.
Charlie
if(!curlies){ return; }
|
|
|
|
|
no, c# needs .net framework.
I want to change Myself..Can u help me?
|
|
|
|
|
Hi, Everyone,
I read from a Microsoft guide on Performance (www.serverside.net) and it says that Windows Services uses Workstaton GC even Server has multiple CPU. The conclusion seems to be that we should not host TCP Remoting in WinSvcs.
My Questions:
(1) Is the above true or false ? (I have seen various opinion on this)
(2) How to configure to use Server GC (
I have some idea but not sure about it. But I will open source it so everyone can comment later.
Your open minded comment are greatly appreicated.
Thanks
James
|
|
|
|
|
|
Mike,
Thanks for your "real-time" response.
I have read both articles: The 1st is great in concept and the 2nd has
usable code.
My Company blocked Blogging so I have to wait till after 6pm at home to read.
I basically modified Steven Pratschner's code and made a Windows Services (.net) that calls Unmanaged API CorBindToRuntimeEx to run a remoting host code. (Just like you said). It really works as a TCP Remoting Host.
Though My problem is that I would rather not use my code since it does not have PROVEN scalability in production.(and I do not have 8-CPU machine anyway)
Is there any code I can download that has been proven ?
Thanks
James
PS. I have no problem upload my code onto www.codeproject.com, so that we developer can improve and test it in this community.
|
|
|
|
|
Hello,
I am using a commercial protocol stack that calls a registered callback function to receive data when the driver it talks to has done it's thing and has new data to report. The sample code that came with the stack uses PostMessage from the Win32 world to send a local copy of the data back to the host GUI/window message parsing thread. This is to avoid thread crossing problems, etc.
I want to do the same thing with a new .NET application. But, I can't see a way to do it. I can't spawn a new thread, call invoke, etc. because I have to follow the signature of the callback function. I can't just add the callback function into my form namespace for the same reason. I can't call PostMessage because .NET hides the message pump parsing and I don't know how to add handling a custom message, assuming I could succesfully send it. IMessage doesn't see to apply... It seems like this would be an easy question.
Thanks for any help.
Mark
|
|
|
|
|
Hi,
I'm developing a setup project. Can you help me with these queries
- How do I get the installation path the user enters at runtime
- How can I copy some files to specified location eg:C:\temp
- How can I check for existence of a particular folder? Is it possible with Launch Condition. If not how can I do it?
-'User Interface -Add Dialog '- How can I get the values entered in the textboxes at runtime and pass it to my application?
- Custom Action properties , properties- Installer Class - true / false signify ?
- How do I start an application when Installation completes ?
Thankx in advance
Priya
|
|
|
|
|
Hi,
when i do this:
string unicodeString = "This string contains the unicode character";
// Create two different encodings.
Encoding ascii = Encoding.ASCII;
Encoding unicode = Encoding.Unicode;
// Convert the string into a byte[].
byte[] unicodeBytes = unicode.GetBytes(unicodeString);
// Perform the conversion from one encoding to the other.
byte[] asciiBytes = Encoding.Convert(unicode, ascii, unicodeBytes);
and I try to convert a Hebrew string to ascii I got in the asciiBytes
the number 69 (equals to '?')
but in english it's work just fine.
What is the problem?
Thank you in advanced,
Eran.
|
|
|
|
|
I'm a little confused about what you are trying to do here. ASCII is not capable of displaying the full range of letters for all character sets. That is one of the reasons why we have Unicode!
It seems like expected behavior to me, or at least not unexpected. If you have an international application, then you should stick to unicode only, if at all possible. Heck, you should probably stick to unicode even if you're not.
If your challenge is that you need to transmit data over a medium that only supports ASCII, consider Base64 encoding.
|
|
|
|
|
I need to convert data i got from a TCP/IP connection.. The data is a unicode string and converted to UTF-8 so that it can be sent on TCP/IP.. The data was sent on a different platform...
Now my task is to convert the data back again to Unicode...
Please help.. i tried to use the sample in MSDN on converting Unicode to Ascii.. i just modified it so that the conversion is Ascii to Unicode..
The problem is that the extended characters in the data are substituted with '?' character..
|
|
|
|
|
ASCII is not the same as UTF8. UTF8 is in fact already unicode. Sounds like you do not have to do anything? Maybe I'm missing something.
|
|
|
|
|
Here's what i want to actually...
For example the data sent was "abcdefüüü"... its a unicode string with special characters.. now the programmer(not a .NET programmer) who sent me the data said that he converted this unicode string to UTF8 first before sending it to the stream...
Now when i got the data from my side, the new string is "abcdefA¼A¼A¼"..
what i need to do is make the string back to "abcdefüüü"..
|
|
|
|
|
well ascii in israel computers the numbers between 128 - 255 its reserved to hebrew
|
|
|
|
|
See "About ASCII Encoding class" in the SDK. The encoding always results in 7 bit characters. It always excludes the extended ASCII characters, i.e. those in the range of 128-255. They will be converted as "?", which has an ASCII byte code of 63.
I do not think you can do what you want with the ASCIIEncoding class. I think perhaps Encoding.Default will work as you expect. This will return an encoding for the system's current ANSI code page. I'm not sure what that means exactly in terms of byte values, but it sounds promising.
|
|
|
|
|
I wrote about the difference between ASCII and 8-bit character sets here[^]. The encoding that the .NET Framework refers to as 'Unicode' is UTF-16 (Little Endian). The encoding referred to as 'Ascii' is ISO-646-US, a 7-bit encoding. Only the code points from 0 to 127 have any meaning; any code outside this range is simply translated to '?'.
If you want to convert an array of bytes representing characters into a System.String object, you must know what character set they represent, and what Windows code page that corresponds to. Windows code page numbers are listed at http://www.microsoft.com/globaldev/reference/WinCP.mspx[^].
For converting UTF-8 to a System.String , you can use the object returned by the System.Text.Encoding.UTF8 property.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hye,
I was wondering if any of you know if the following is possible : Run an applet, a service...which would act as an FTP client but the connection to the remote server should be initiated from the server side and not the client side! There are hundreds of good client side FTP client but no server side apparently. The reason why I'm asking is that I need an FTP client but I cannot connect to the target FTP server from the client, only from the server where the web service is running.
Thanks in advance !
|
|
|
|