Recent Updates Toggle Comment Threads | Keyboard Shortcuts

  • huseyincakir 7:39 pm on January 6, 2014 Permalink | Reply  

    Sending Mail Async 

    This post is for an answer to “how can I show progress of sending mail” question for my old post: http://huseyincakir.wordpress.com/2010/03/11/mono-c-sending-mail-through-gmail/

    Here is my solution;

    using System;
    using System.Net.Mail;
    using System.Collections.Generic;
    using System.Text;
    using Gtk;
    using GtkSharp;
    using GLib;
    using System.Net;
    using System.Security.Cryptography.X509Certificates;
    using System.Net.Security;
    using System.Net.Mime;
    using System.Threading;
    using System.ComponentModel;
    namespace KentSoft
    {
     class printTest : Window
     {
     public printTest()
     : base("calisma")
     {
    
     try{
     MailMessage mail = new MailMessage();
     SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
     mail.From = new MailAddress("yourmail@gmail.com");
     mail.To.Add("hismail@gmail.com");
     mail.Subject = "TEST";
     mail.Body = "This is for testing SMTP mail from GMAIL";
     SmtpServer.Port = 587;
     SmtpServer.Credentials = new System.Net.NetworkCredential("youmailwithout@gmail.com", "yourpassword");
     SmtpServer.EnableSsl = true;
    
     SmtpServer.SendCompleted += new SendCompletedEventHandler(client_SendCompleted);
    
     string userState = "test message1";
     SmtpServer.SendAsync(mail, userState);
     Console.WriteLine("Sending message... press c to cancel mail. Press any other key to exit.");
     string answer = Console.ReadLine();
     // If the user canceled the send, and mail hasn't been sent yet,
     // then cancel the pending operation.
     if (answer.StartsWith("c") && mailSent == false)
     {
     SmtpServer.SendAsyncCancel();
     }
     // Clean up.
     mail.Dispose();
     Console.WriteLine("Goodbye.");
     }
    
     catch(Exception e){
     Console.WriteLine("Ouch!"+e.ToString());
     }
     }
    
    void client_SendCompleted(object sender, AsyncCompletedEventArgs e)
     {
     // Get the unique identifier for this asynchronous operation.
     String token = (string) e.UserState;
    
    if (e.Cancelled)
     {
     Console.WriteLine("[{0}] Send canceled.", token);
     }
     if (e.Error != null)
     {
     Console.WriteLine("[{0}] {1}", token, e.Error.ToString());
     } else
     {
     Console.WriteLine("Message sent.");
     }
     mailSent = true;
     }
     static bool mailSent = false;
    
     public static void Main()
     {
     Application.Init();
     new printTest();
     Application.Run();
     }
     }
    }
    
     
  • huseyincakir 12:40 pm on December 29, 2013 Permalink | Reply  

    Developing Native Application on Android with HTML Thanks to PhoneGap 

    Hi this is my last post for 2013! so I thank for those coders who managed to sent me lots of spam messages :) but moreover I want to share my site stats with you and than code for fu n again :)

    And here is the stats for huseyincakir.wordpress.com :

    So we have 103,034 views which is not bad  :) but falling deep in 2013 like Adele says nevermind I’m still posting :)

    Adsız

    After some boring stats now time for coding again. Our aim is to develop Android application that uses HTML and CSS. I know these staff are wellknown by most developers but I put is here in case some needs help. So let us start some work;

    Required Links:

    [1.] The Best Tutorial on Issue: http://www.adobe.com/devnet/html5/articles/getting-started-with-phonegap-in-eclipse-for-android.html

    [2.] PhoneGap Libs: http://stackoverflow.com/questions/13399550/copying-cordova-2-2-0-jar

    [3.] Sample Project To Start: https://drive.google.com/file/d/0B5CGxG0MWhPtT0U5ZmtCM0dmX3M/edit?usp=sharing

    [4.] See Application on Device Rather than Emulatorhttp://www.apkinstall.com/

    My Screencast:

    Better ways still exists in developing applications on Android for instance Xamarin.Android(CSharp). But using HTML is also good opportunity for those who familiar with HTML/CSS.

    Have a look: http://xamarin.com/Android

     
  • huseyincakir 10:41 pm on December 7, 2013 Permalink | Reply  

    GTKRC – An Easy Sample 

    Best defnition for gtkrc I got from; http://orford.org/gtk/

    Gtk programmers will tell you that writing a gtk theme is easy. If you have a full understanding of how gtk is put together, then that may be so, but if you dont have an intimate knowledge of the gtk api and you want to change the visual appearance of your gtk apps then this document may hopefully save you some swearing while you go through the process of trial and error trying to figure out what works and what doesnt. Its not difficult stuff, but can appear to be somewhat random and non-intuitive due to its close correlation with the underlying widget structure.

    Example:

    [1.] Before gtkrc;

    34

    [2.] We choose theme from: http://ftp.gnome.org/pub/gnome/teams/art.gnome.org/themes/gtk2/

    [3.] Copy the gtkrc;

    35

    [4.] Result our new look;

    asa

     
    • bankruptcy attorney in Ft Myers Florida 11:50 pm on December 16, 2013 Permalink | Reply

      I really like what you guys are up too. This kind of clever work and coverage! Keep up the awesome works guys I’ve included you guys to my blogroll.

c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel
Follow

Get every new post delivered to your Inbox.

Join 99 other followers