|
Those a control characters to SendKeys. If you want to send those actual characters, you have to enclose them in the curly braces.
He's sending Control-V, which is correct in his code.
The technique, on the other hand, of using SendKeys at all is suspect.
|
|
|
|
|
I agree. Basically, using SendKeys is per definition unreliable. Best to code what you want (and keep control), rather than relying on a quirky method that can go wrong at any turn.
|
|
|
|
|
Try running remote desktop in full screen mode.
Apparentely, Remote Desktop only acknowledges key strokes in full screen mode.
Too much of heaven can bring you underground
Heaven can always turn around
Too much of heaven, our life is all hell bound
Heaven, the kill that makes no sound
|
|
|
|
|
Try sending an additional printable character afterwards, e.g. a space: "^v ". Some time ago, I experienced a situation where that helped, but I do not know why that worked...
|
|
|
|
|
What's involved in converting a hierarchy of classes to an XML file? I'm not talking about serialization. I just want to take a collection of objects and create an XML file out of it?
Thanks
Everything makes sense in someone's mind
|
|
|
|
|
Kevin Marois wrote: I just want to take a collection of objects and create an XML file out of it?
Actually, that is serialisation, to XML at least. The path of least resistance is to use the built in XML serialisation.
If you don't want to do this you nned to use reflection to traverse the object graph whilst writing the XML to file.This is slightly harder than it sounds,as you also need to take into account collections and potential loops in the graph.
Personally, I'd go for the built-in option if possible. You can write your own formatter if the built in one isn't to requirements.
|
|
|
|
|
Here's one way.[^]
(Whoops, pasted the wrong link. )
modified on Monday, July 11, 2011 10:40 PM
|
|
|
|
|
Kevin Marois wrote: I'm not talking about serialization
Yes, you are. Cue the wiki quote
serialization is the process of converting a data structure or object into a format that can be stored (for example, in a file... .
Start with the docs for XmlSerializer here: http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx[^]. There are plenty of examples on that page of the default, as well as finely controlled serialization.
|
|
|
|
|
I'd like to write an application that monitors connections to my machine through the sessions portion of computer management. I have win7 32 bit and .net 3.5 .
Can anyone point me in the right direction on which c# methods I should be looking at?
Thanks!
|
|
|
|
|
You will have to look up the API for 'the sessions portion of computer management' (not sure what that is myself but hopefully you do!), and call the appropriate methods through P/Invoke.
|
|
|
|
|
|
Hi Ken,
Thanks for the response.
I was able to get this working today, the only problem is that I cannot close the session. It appears that this is a Windows thing, because I see the same behavior when I do so within computer management. I can right click and say "Close session" and then refresh and it will reappear.
I was wondering if you had any ideas on how to actually close the session?
In my code, I am calling session.Delete(); without any success.
Thank you
|
|
|
|
|
The blizzard authentication is really cool, just as well as all other RSA tokens. I understand that synchronization plays an important role in this matter, but when using RSA or authenticated encryption, isn't its main goal based on time of the day that this information is generated? If so, if the server goes down, doesn't that mess up the synchronization with all other devices?
|
|
|
|
|
My understanding is that the Blizzard authenticator is purely a number generating machine.
It does not depend on the time - if you ever use an RSA token you will find that each time a new number shows a bar also decreases in size.
With an RSA token you need to enter the number generally while there are still two bars left due to this synchronization issue.
The Blizzard authenticator has no such countdown bar.
I think this question may also need to go to the lounge as it is not really a C# question
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
modified on Tuesday, July 12, 2011 3:03 AM
|
|
|
|
|
Hi,
How I can turn on and off write protection in my dvd rw drive
programmatically. this is possible through c# or not.
Thanks for any suggestion...........
|
|
|
|
|
|
hello Monica,
i didn't find solution using WMI......
if you suggest me any WMI class dan i'll try again..
thank u
|
|
|
|
|
Hello. I need to develop an sms application to send sms to all customers phone numbers immediately an item comes into stock. Please i need to understand the basics. How to cut out sms resellers and develop my own. please its important and urgent.
Thank you for your anticipated response and clear help.\
kind regards
hassan
stay jacking
|
|
|
|
|
Hi
just try out way2sms free api.
use predefined commands and function to send sms
|
|
|
|
|
For a heads-up, you need to get a GSM modem (or a CDMA modem), attach it to your PC and use the API provided with the modem to send SMS.
And do not use words like "important" or "urgent" here. People in CP help others in their leisure, it may be urgent for you, but not for us here.
|
|
|
|
|
Don't cross post. Read the forum guidelines. Pick one forum and use it.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
I actually used this feature provided in VB.NET, as a project for a break alarm here at work. It was made to notify people of the breaks about to end 5-10min prior to the end of the break. Of course it was used through via Email the mobile number. So the down side is, is that people had to use their email account credentials to setup the automatic notification. Of course the contrast in this to match what he expects would to be setting up a generic email account and of course applied directly to the code for the notification. At least that is my 2 copper. The implementation is very easy and with just a few lines of code. Use c# > vb for better management. But for unfamiliarity use the vb.net
|
|
|
|
|
Code for VB.NET
<pre>
Try
Dim insMail As New MailMessage()
With insMail
.From = strFrom
.To = strTo
.Subject = strSubject
.Body = strBody
.Cc = strCC
If Not strAttachments.Equals(String.Empty) Then
Dim strFile As String
Dim strAttach() As String = strAttachments.Split(";")
For Each strFile In strAttach
.Attachments.Add(New MailAttachment(strFile.Trim()))
Next
End If
End With
If Not strSMTPServer.Equals(String.Empty) Then
SmtpMail.SmtpServer = strSMTPServer
End If
SmtpMail.Send(insMail)
Catch e As Exception
Console.WriteLine(e.Message)
End Try
</pre>
Then pick from the list in which your employees have the provider:
<a href="http://en.wikipedia.org/wiki/List_of_SMS_gateways">SMS Gateway Listing</a>
The code is easily converted to c#
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.Mail;
namespace EmailSMS
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
MailMessage SMS = new MailMessage();
SmtpClient SMTP_Server = new SmtpClient(SMTP_Server_Name);
SMTP_Server.Credentials = new System.Net.NetworkCredential(userName, password);
SMS.From = SMS_From;
SMS.To = SMS_To;
SMS.Subject = SMS_Subject;
SMS.Body = SMS_Body;
SMTP_Server.Port = SMTP_Port;
SMTP_Server.EnableSsl = true OR false;
SMTP_Server.Send();
MessageBox.Show("SMS St Successfully!");
}
catch (Exception ex)
{
MessageBox.Show("Error while trying to send SMS.\n\nError: ", ex.ToString());
};
}
}
}
In C#, Cutting out the SMS re sellers is like telling your employees to give up their carriers and switch to yours when you can't provide a reliable service. Use the generic email system, it helps and is less of a hassle. What I provided is a breakdown of what you can accomplish with the code. Its not much, so make use of it.
|
|
|
|