|
hi
How do can i send a sms through C#.
arnab
xzv
|
|
|
|
|
That depends on the service provider.
The service provider we use only requires a uri request which includes your account username password, the message and the numbers to which you want to send
He who laughs last is a bit on the slow side
|
|
|
|
|
Hi
thanx for the reply but i am sorry..i can't understand that. accually i want the code for sending sms.
do u help me for how i use the service provider and username,password etc.
xzv
|
|
|
|
|
First you need to decide on the service provider you want to use to supply you with the sms's.
With them you can send sms's using your Address bar of your web browser.
ie.. www.serviceprovider.com?username?password?message?numb1,numb2 etc, just to give you a basic idea.
So through your code you build that string, then you can use command prompt to execute that line or you can use httpWebRequest.
So contact your service provider and find out from there what their requirements are, they surely will have had such a request before and might have an easier approach to this.
I know that some service provider even have prebuild webservice classes that you can just attach onto your application, that contains all needed methods for sending messages, it has needed connection settings to their servers etc.
He who laughs last is a bit on the slow side
|
|
|
|
|
I don't know how to monitor the keystrokes made on my keyboard.
To save the keystrokes of all working programs.
I have Visual Studio 2003.
Help please.
Vasildb
|
|
|
|
|
To receive system-wide keyboard input you need to use a global keyboard hook. There are some articles here on CP that cover the use of global hooks.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
i'm getting the menu container from another form..this is code..
frmMain obj_frmMain = new frmMain();
this.Menu = obj_frmMain.mainMenu1.CloneMenu();
HOW TO GET THE CLICK EVENT OR CONTROL(MENUITEM) IN MY FORM..
|
|
|
|
|
I assume your cloning of the menu was an attempt to take the events of the menu???
Wrong.
In the main form you will have to make a public accessor to your menu.
Then in your application:
frmMain mainMenu = new frmMain();
mainMenu.Menu.MyMenuOption.Click += new ClickEventHandler(MyEventHandler);
BTW: I see you are still using very old naming conventions in your code. To make it more usable you may want to read up on the Microsoft Naming Standards for .NET.
|
|
|
|
|
Hi there,
I am trying to write a procedure where my application can write some information to a file should the running executable crashes. The written info should be related to the crash, and it may be a help to understand why it happened. In C and C++, miini dump is used, what can I use for C# projects?
Please help
Many thnx
raff
|
|
|
|
|
You could attach a handler to Application.ThreadException and simply write the information of the exception to a file, this could be done by serialization. It depends on what information you want to save to disk.
Sig cops got me...
|
|
|
|
|
How did you generate minidumps in C/C++? You could get minidumps with C# also with the same method, and they'll typically contain more stack and memory information.
|
|
|
|
|
hi
i have problem in c#. how to create messenger like that yahoo.
thirumal rao
|
|
|
|
|
shri_scorpio wrote: how to create messenger like that yahoo.
By writing some code...
If you want a more specific answer than that, I am afraid that you have to ask a more specific question.
---
b { font-weight: normal; }
|
|
|
|
|
I think your problem is that you're knowledge in C# is not (yet) profound enough to develop a messenger application...
Determin first how you're going to send the data over the internet. If you know that, then you can ask here on CP what classes you use eg...
Good luck.
|
|
|
|
|
Hi,
You can find such application hare in codeproect only.....
<marquee>nishu
|
|
|
|
|
how to select the picture box on run time and how to resize this picture box?please help
|
|
|
|
|
hi
pictureBox1.Image = Image.FromFile("1.jpg");
pictureBox1.Size = new Size(width,height);
// hope i help you with resizing.....
Tamimi - Code
|
|
|
|
|
thanks..
but i want select the border and then resize that image
|
|
|
|
|
use a panel(base panel for the size you feel max for your streching)
in it put three panels and two splitter controls as following
p s p
s
p
dock them accordingly and you have it
p=> panel
s=> splitter
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
Hi,
I tried encrypting and decrypting a string using the following Java code and key. And was successful.
Then, I used the following C# to encrypt and decrypt a string using the following C# code and key. And was successful.
But when i tried to encrypted using java and decrypted using C#, but it was not successful.
Can someone please help? THanks in advanced.
[JAVA code]
private static String algorithm = "DESede";
private static Key key = null;
private static Cipher cipher = null;
private static void setUp() throws Exception {
key = new SecretKeySpec("123456789012345678901234".getBytes(), algorithm);
cipher = Cipher.getInstance(algorithm);
}
public static void main(String[] args) throws Exception {
setUp();
byte[] encryptionBytes = null;
encryptionBytes = encrypt("This is a testing");
System.out.println("Recovered: " + decrypt(encryptionBytes));
}
private static byte[] encrypt(String input) throws InvalidKeyException,
BadPaddingException, IllegalBlockSizeException {
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] inputBytes = input.getBytes();
return cipher.doFinal(inputBytes);
}
private static String decrypt(byte[] encryptionBytes) throws
InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] recoveredBytes = cipher.doFinal(encryptionBytes);
String recovered = new String(recoveredBytes);
return recovered;
}
[C# Code]
static void Main()
{
try
{
TripleDESCryptoServiceProvider tDESalg = new
TripleDESCryptoServiceProvider();
// Create a string to encrypt.
string sData = "This is a testing";
// Encrypt the string to an in-memory buffer.
byte[] key = Encoding.UTF8.GetBytes("123456789012345678901234");
byte[] Data = EncryptTextToMemory(sData, key, key);
string Final = DecryptTextFromMemory(Data, key, key);
// Display the decrypted string to the console.
Console.WriteLine(Final);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
public static byte[] EncryptTextToMemory(string Data, byte[] Key, byte[] IV)
{
try
{
// Create a MemoryStream.
MemoryStream mStream = new MemoryStream();
// Create a CryptoStream using the MemoryStream
// and the passed key and initialization vector (IV).
CryptoStream cStream = new CryptoStream(mStream,
new TripleDESCryptoServiceProvider().CreateEncryptor(Key, IV),
CryptoStreamMode.Write);
// Convert the passed string to a byte array.
byte[] toEncrypt = Encoding.UTF8.GetBytes(Data);
// Write the byte array to the crypto stream and flush it.
cStream.Write(toEncrypt, 0, toEncrypt.Length);
cStream.FlushFinalBlock();
// Get an array of bytes from the
// MemoryStream that holds the
// encrypted data.
byte[] ret = mStream.ToArray();
// Close the streams.
cStream.Close();
mStream.Close();
// Return the encrypted buffer.
return ret;
}
catch (CryptographicException e)
{
Console.WriteLine("A Cryptographic error occurred: {0}", e.Message);
return null;
}
}
public static string DecryptTextFromMemory(byte[] Data, byte[] Key, byte[] IV)
{
try
{
// Create a new MemoryStream using the passed
// array of encrypted data.
MemoryStream msDecrypt = new MemoryStream(Data);
// Create a CryptoStream using the MemoryStream
// and the passed key and initialization vector (IV).
CryptoStream csDecrypt = new CryptoStream(msDecrypt,
new TripleDESCryptoServiceProvider().CreateDecryptor(Key, IV),
CryptoStreamMode.Read);
// Create buffer to hold the decrypted data.
byte[] fromEncrypt = new byte[Data.Length];
// Read the decrypted data out of the crypto stream
// and place it into the temporary buffer.
csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length);
//Convert the buffer into a string and return it.
return new ASCIIEncoding().GetString(fromEncrypt);
}
catch (CryptographicException e)
{
Console.WriteLine("A Cryptographic error occurred: {0}", e.Message);
return null;
}
}
|
|
|
|
|
VS 2003
C#: Windows Application - DataForm Wizard
3 records, Add 1 record
-----------------
Hi, I have a DataGrid and Textboxes link to the objCustomerDataset. When I add new record, after I click update button, the record is updated (Seen in Datagrid). The problem here is when I closed my form and relaunch, the pointer in the datagrid always point to the new record and the textboxes record (using DtatForm Wizard) to create is also at the new record. How do I reload the pointer to point at first record??
Note: I placed this.LoadDataset() at the form initialize.
|
|
|
|
|
hi, hope this will help
dataGrid1.CurrentCell = new DataGridCell(0,0);
Tamimi - Code
|
|
|
|
|
Hi, where do I insert this code?
|
|
|
|
|
hi
whereever you want !!!!!!!!
like when load the data, on button pressed
Tamimi - Code
|
|
|
|
|
I have an XmlNodeList and I just want to reverse the order of it. I have to keep it as an XmlNodeList because my repeater control (which I bind to it) depends on that.
/\ |_ E X E GG
|
|
|
|