Click here to Skip to main content
15,915,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: Editing text in body of email via Outlook add-in Pin
Richard MacCutchan8-Mar-18 0:15
mveRichard MacCutchan8-Mar-18 0:15 
GeneralRe: Editing text in body of email via Outlook add-in Pin
Eddy Vluggen8-Mar-18 0:21
professionalEddy Vluggen8-Mar-18 0:21 
AnswerRe: Editing text in body of email via Outlook add-in Pin
Eddy Vluggen8-Mar-18 0:24
professionalEddy Vluggen8-Mar-18 0:24 
AnswerRe: Editing text in body of email via Outlook add-in Pin
Rakanoth8-Mar-18 22:48
Rakanoth8-Mar-18 22:48 
Questionhow can i set windows form over other programs at the desktop in c# Pin
galba20185-Mar-18 22:11
galba20185-Mar-18 22:11 
AnswerRe: how can i set windows form over other programs at the desktop in c# Pin
OriginalGriff5-Mar-18 22:31
mveOriginalGriff5-Mar-18 22:31 
AnswerRe: how can i set windows form over other programs at the desktop in c# PinPopular
Eddy Vluggen6-Mar-18 1:10
professionalEddy Vluggen6-Mar-18 1:10 
GeneralRe: how can i set windows form over other programs at the desktop in c# Pin
galba20186-Mar-18 2:00
galba20186-Mar-18 2:00 
GeneralRe: how can i set windows form over other programs at the desktop in c# Pin
Eddy Vluggen6-Mar-18 2:04
professionalEddy Vluggen6-Mar-18 2:04 
AnswerRe: how can i set windows form over other programs at the desktop in c# Pin
Gerry Schmitz6-Mar-18 6:07
mveGerry Schmitz6-Mar-18 6:07 
AnswerRe: how can i set windows form over other programs at the desktop in c# Pin
Dave Kreskowiak8-Mar-18 4:16
mveDave Kreskowiak8-Mar-18 4:16 
Questionapple push notification Pin
Member 108437285-Mar-18 20:22
Member 108437285-Mar-18 20:22 
AnswerRe: apple push notification Pin
Pete O'Hanlon5-Mar-18 20:28
mvePete O'Hanlon5-Mar-18 20:28 
GeneralRe: apple push notification Pin
Member 108437285-Mar-18 20:35
Member 108437285-Mar-18 20:35 
GeneralRe: apple push notification Pin
Pete O'Hanlon5-Mar-18 20:54
mvePete O'Hanlon5-Mar-18 20:54 
GeneralRe: apple push notification Pin
Member 108437285-Mar-18 21:11
Member 108437285-Mar-18 21:11 
this is my code

int port = 2195;
            String hostname = "gateway.push.apple.com";

try
           {
               TcpClient client = new TcpClient(hostname, port);
               SslStream sslStream = new SslStream(client.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null);

               try
               {
                   sslStream.AuthenticateAsClient(hostname, certificatesCollection, System.Security.Authentication.SslProtocols.Tls, false);

                   for (int i = 0; i < Token.Length; i++)
                   {
                       HttpContext.Current.Trace.Warn("inside sendPushNotificationApple, dt=" + Token[i]);
                       MemoryStream memoryStream = new MemoryStream();
                       BinaryWriter writer = new BinaryWriter(memoryStream);
                       writer.Write((byte)0);
                       writer.Write((byte)0);
                       writer.Write((byte)32);

                       writer.Write(HexStringToByteArray(Token[i]));
                       String payload = "{ \"aps\" : { \"alert\" : {\"title\" : \"" + szAppName + "\",\"body\" : \"" + message + "\",\"Type\" : \"" + szType + "\"} }}";
                       HttpContext.Current.Trace.Warn("inside sendPushNotificationApple, payload=" + payload.ToString());
                       writer.Write((byte)0);
                       //writer.Write((byte)payload.Length);
                       byte[] b1 = System.Text.Encoding.UTF8.GetBytes(payload);
                       writer.Write((byte)b1.Length);
                       writer.Write(b1);
                       writer.Flush();
                       byte[] array = memoryStream.ToArray();
                       sslStream.Write(array);
                       sslStream.Flush();
                   }

                   client.Close();
               }
               catch (System.Security.Authentication.AuthenticationException ex)
               {
                   HttpContext.Current.Trace.Warn("inside sendPushNotificationApple, AuthenticationException=" + ex.ToString());
                   client.Close();
               }
               catch (Exception exp)
               {
                   HttpContext.Current.Trace.Warn("inside sendPushNotificationApple, Exception=" + exp.ToString());
                   client.Close();
               }
           }
           catch (Exception ex)
           {
               HttpContext.Current.Trace.Warn("inside sendPushNotificationApple, Exception1=" + ex.ToString());
           }

GeneralRe: apple push notification Pin
Gerry Schmitz6-Mar-18 5:58
mveGerry Schmitz6-Mar-18 5:58 
QuestionTaskFactory Class Pin
Member 137105305-Mar-18 16:37
Member 137105305-Mar-18 16:37 
AnswerRe: TaskFactory Class Pin
Pete O'Hanlon5-Mar-18 20:20
mvePete O'Hanlon5-Mar-18 20:20 
GeneralRe: TaskFactory Class Pin
Member 137105307-Mar-18 6:13
Member 137105307-Mar-18 6:13 
AnswerRe: TaskFactory Class Pin
Gerry Schmitz7-Mar-18 7:40
mveGerry Schmitz7-Mar-18 7:40 
GeneralRe: TaskFactory Class Pin
Member 1371053019-Mar-18 18:00
Member 1371053019-Mar-18 18:00 
Questionc# parsing CAN dbc files Pin
Member 135713645-Mar-18 4:05
Member 135713645-Mar-18 4:05 
AnswerRe: c# parsing CAN dbc files Pin
Maciej Los5-Mar-18 20:27
mveMaciej Los5-Mar-18 20:27 
GeneralRe: c# parsing CAN dbc files Pin
Member 135713645-Mar-18 20:34
Member 135713645-Mar-18 20:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.