|
Yeah, that's why I do my research in the documentation instead of Intellisense. There's lots of hidden stuff in the docs that you'll never see anywhere else.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
dear
if we have a timer counts to 10 seconds and 10000 tick .
how can we put the x coordinate of the mouse move every tick of the timer in an array of 10000 elements .?
thank you
ahmad al-omar
|
|
|
|
|
Use Cursor.Position to find out where the mouse is.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
First declare array:
Point[] coordinates = new Point[10000];
And in method executed when timer ticks, use this code:
points[i] = Cursor.Position;
|
|
|
|
|
hi
i want to use Trigger in Sql Server 2005, please give me an example that how to use Triggers for Insert,Update and Delete events ..
thanks
|
|
|
|
|
Which bit are you stuck on ? Which of the many websites that offer help on this have you looked at ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
can u say me which site has example for Triggers ??
|
|
|
|
|
Here[^]
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi all! It's my first time to write, hope somebody can help me
I am creating an application that at a certain point opens an all screen form formed by a "grid" of buttons.
I would like some of these buttons to visualize (besides a title) an image on them, that may be modified (e.g. become semi-transparent)at run-time: at the moment an event is fired (in particular clicking on the same button).
How should I do? Should I use the BackgroundImage or Image of the Button class? Should I put a PictureBox on the button? Or should I use to create my buttons another class than Button, maybe more complex and suitable for my purpose?
I already tried something, but with not much success!
Sorry for my English, thanx for your help!
Davide
|
|
|
|
|
Derive a class from Button, handle the paint event, and draw your image whatever way you like.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I'm building an application that needs to sign some text. and than save the text and the signature in a file. Another application than reads this file and verifies it's contents using this hash. For this to work as I want, I need to convert the byte array containing the signature to a string to put at the end of the file. Next the recipient reads the string and converts it back to an byte array so the text can be verified.
I us the next code example to test. there are two blocks of code one using Encoding.Default and one using Encoding.Unicode. Using encoding.default works and give the correct answer true, the other does not.
Can anyone explain why using encoding.unicode doesn't work, or at least how to do the string <-> byte array conversions codepage independent?
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
using System.Security.Cryptography;<br />
<br />
namespace WindowsApplication1<br />
{<br />
public partial class Form1 : Form<br />
{<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
<br />
<br />
RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();<br />
<br />
byte [] signature = RSA.SignData(Encoding.Unicode.GetBytes("test"), "SHA1");<br />
<br />
<br />
string temp = Encoding.Default.GetString(signature);<br />
signature = Encoding.Default.GetBytes(temp);<br />
<br />
bool verified = RSA.VerifyData(Encoding.Unicode.GetBytes("test"), "SHA1", signature);<br />
<br />
MessageBox.Show(verified.ToString());<br />
<br />
}<br />
}<br />
}<br />
|
|
|
|
|
The reason that you have problem decoding the signature to a string, is that it is not at all an encoded string to begin with.
When you are decoding it as if it were an encoded string, it depends on what encoding you are using and the content of the signature how much data you lose in the process.
If you want to send the signature as a string, just use Convert.ToBase64String and Convert.FromBase64String to get a string representation of the byte array and to get the byte array back.
---
single minded; short sighted; long gone;
|
|
|
|
|
I'm not going to pretend I completely understand your answer. I did however test using convert to and from base64 and it seems to work correctly and should be completely system independent as I understand it. I defenitely need to read up on my understanding of encodings.
Thanks for the quick answer!
|
|
|
|
|
I need help,
I had these sintax select id as random from table where id = '1', but this not help me.
If anybody can help me to write good sintax for select id random from a table
|
|
|
|
|
which database are you using?????
Signature has been encrypted
|
|
|
|
|
I am using MS SQL Server 2000
|
|
|
|
|
I asked this earlier, and Stefan Troschtz gave me an answer (thanks), but it wasn't what i was looking for and I think it was because i didn't explain it well enough. What code should i have in my program so that when a process is started of a file, and it is the type that my program opens, my program opens it? ex. when you start a process for a website, internet explorer opens it, when you open a .psd Photoshop opens it. Basically I am asking how i should pass the filename to my program so that it opens the file it should be opening. Or if that is not what you would do, what would you do?
Thanks again.
|
|
|
|
|
|
Firstly, it would have been better to keep this to the original thread where others could benifit from knowing what advice you've already been given.
Secondly, your application would need to process command line arguments.
As an example, if you had a text file named "myfile.foo" in the same directory as you appliation, you would be able to pass the filename to your application at the command prompt by typing "myApp.exe myfile.foo" or alternatively drag & drop the Foo file onto your exe.
This would start your application which could then perform any function you like.
It would obviously make sense that you application check the file extension ".foo" was correct before doing anything.
For more information on command line arguments, look here: http://msdn2.microsoft.com/en-us/library/acy3edy3.aspx
You could rig up a test application? If you create a new console application, you can paste the following code to replace the Main method:
public static void Main(string[] args)
{
if ( args.Length > 0 )
{
if ( args[0].ToLower().EndsWith(".foo") )
Console.WriteLine( "Openning Foofile named {0}", args[0] );
}
Console.WriteLine("Press any key to continue...");
Console.ReadKey();
}
If you then build the application and create a text file named "test.foo" in the same folder, you should be able to drag & drop the Foo file onto your app.
This should run the app which simply displays the full path to the Foo file.
Once you've got this working, you've just got to create some method to actually do something with the file.
I guess it depends what you want it to do?
Lastly, you would have to associate an file extension with your application so that Windows knows what to do when somone tries to open this type of file. This is normally the job of an installer like InstallShield however, you can make this association manually.
If you double-click the Foo file, windows will normally complain that it cant open the file, then..
1) Simply select "Select a program from the list" and click "OK"
2) Tick the box which reads "Always use the selected program to open this kind of file"
3) The click the "browse" button where you can search for your application.
Foo files would always be opened by your application.
Hope this helps
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
Hello, and thanks.
I can get the command prompt to work pretty well, but now I want a more graphical program. I have tried changing the code that you suggested and the code that I found at MSDN online to fit the Windows Interface template in Visual Studio 2005, but I have not been successful. I have tried searching some more for the solution, but have not found anything more about the Main(). So if you know of a website that would be helpful in creating what i am looking for, or if you have a quick simple solution, that would be very helpful.
Thanks again.
|
|
|
|
|
Ok, the pointer should have been enough to get the ball rolling. It showed one way to obtain the file name passed as a command line argument.
What you do from here on is up to you.
Windows Forms applications pass command line arguments in the same way, the only difference is how you reference the arguments.
One way would be to use a member variable to hold the filename. If you make this a public static you can then access if from anywhere within your application. You could do something as follows:
public static string FooFileName = null;
[STAThread]
public static void Main(string[] args)
{
if ( args.Length > 0 && args[0].ToLower().EndsWith(".foo") )
{
FooFileName = args[0];
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
public MainForm()
{
InitializeComponent();
if ( FooFileName != null )
{
MessageBox.Show( String.Format("FooFile Name: {0}", FooFileName) );
}
}
Another way would be to create a constructor which allows the filename to be passed as follows:
[STAThread]
public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if ( args.Length > 0 && args[0].ToLower().EndsWith(".foo") )
{
Application.Run(new MainForm( args[0] ));
} else {
Application.Run(new MainForm( null ));
}
}
public MainForm( string FooFileName )
{
InitializeComponent();
if ( FooFileName != null ) MessageBox.Show( String.Format("FooFile name: {0}", FooFileName) );
}
Does that help??
If so maybe you would consider rating my answer? If not maybe we should consider further discussions via email.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
|
Take a look at the Interop classes provided by Microsoft for interacting with Word and Excel etc. Although these will require that Word is installed on the same machine. Alternatively there are some controls available on the internet (both free and commercial) that will do spell checking for you.
|
|
|
|
|
Hi,
I am using Panasonic KX-TEM824 PABX board. I want read data using C#.NET.
I used Serial Port package in C#.NET 2.0. But its not receiving any data.
Please give me a soloution.
THnx in advance
Thnx
Naffi
|
|
|
|
|
Hi Naffi,
I have a few questions:
1). Which operating system are you using with your PBX?
2). Are you using the Programmator software with your hardware?
3). Which version of Visual Studio are you using? I assume you are using VS 2005+ for the serial port support.
4). Are you receiving any data at all at the port?
Try connecting the hardware to your computer and use hyperterminal to determine if you are receiving data to the port.
Ron Birkelbach
Kennebec, Inc.
|
|
|
|