Recent Updates Toggle Comment Threads | Keyboard Shortcuts

  • huseyincakir 3:33 pm on August 27, 2015 Permalink | Reply  

    Send commands to a remote device over putty/ssh – Putty send command from command line 

    Code:
    
    using System;
    using System.Diagnostics;
    namespace playSound
    {
        class Program
        {
            public static void Main(string[] args)
            {
                Console.WriteLine(args[0]);
                
                Process amixerMediaProcess = new Process();
                amixerMediaProcess.StartInfo.CreateNoWindow = false;
                amixerMediaProcess.StartInfo.UseShellExecute = false;
                amixerMediaProcess.StartInfo.ErrorDialog = false;
                amixerMediaProcess.StartInfo.RedirectStandardOutput = false;
                amixerMediaProcess.StartInfo.RedirectStandardInput = false;
                amixerMediaProcess.StartInfo.RedirectStandardError = false;
                amixerMediaProcess.EnableRaisingEvents = true;
    
                amixerMediaProcess.StartInfo.Arguments = string.Format("{0}","-ssh username@"+args[0]+" -pw password -m commands.txt");
                amixerMediaProcess.StartInfo.FileName = "plink.exe";
                amixerMediaProcess.Start();
                
                
                Console.Write("Press any key to continue . . . ");
                Console.ReadKey(true);
            }
        }
    }
    
    
    
    Sample commands.txt:
    
    ps
    
    Untitled
     
  • huseyincakir 1:21 pm on February 19, 2015 Permalink | Reply  

    Mono GtkSharp Application at Taskbar 

    using System;
    using Gtk;
    using Gdk;
    
    namespace monoGTK_Test
    {
        class  gtkTest : Gtk.Window
        {
            private static StatusIcon trayIcon;
    
            public  gtkTest() : base("monoGTK_Test")
            {
                trayIcon = new StatusIcon(new Pixbuf ("theIcon.png"));
                trayIcon.Visible = true;
                trayIcon.PopupMenu += OnTrayIconPopup;
                
                this.SetSizeRequest(300,300);
                this.ShowAll();
            }
            static void OnTrayIconPopup (object o, EventArgs args)
            {
                Menu popupMenu = new Menu();
                
                ImageMenuItem menuItemQuit = new ImageMenuItem ("QUIT");
                Gtk.Image imgmenuItemQuit = new Gtk.Image(Stock.Quit, IconSize.Menu);
                menuItemQuit.Image = imgmenuItemQuit;
                
                
                
                ImageMenuItem menuItemTIME = new ImageMenuItem ("CHK NOW!");
                Gtk.Image imgmenuItemTIME = new Gtk.Image("icon_passive.png");
                menuItemTIME.Image = imgmenuItemTIME;
                
                popupMenu.Add(menuItemQuit);
    
                popupMenu.Add(menuItemTIME);
                menuItemQuit.Activated += delegate { Application.Quit(); };
    
                menuItemTIME.Activated+= new EventHandler(menuItemTIME_Activated);
                popupMenu.ShowAll();
                popupMenu.Popup();
            }
            static void menuItemTIME_Activated(object sender, EventArgs e)
            {
                Console.WriteLine("menuItemTIME_Activated");
            }
    
            public static void Main()
            {
                Application.Init();
                new gtkTest();
                Application.Run();
            }
    
            
        }
    }
    

    Output:
    taskbar

    Download:
    https://drive.google.com/file/d/0B5CGxG0MWhPtQkZUOFp5RVpjelU/view?usp=sharing

     
    • mklee 6:13 am on April 2, 2015 Permalink | Reply

      Thank you very much
      Do you know how to change a fixed background image?
      Please

      • huseyincakir 6:49 am on April 2, 2015 Permalink | Reply

        I made a solutioun, you can download:

        https://www.dropbox.com/s/z464gb1u1v61xin/fixedBgImg.zip?dl=0

        Solution is like that:

        Program.cs:
        string fileName = @”gtkrc3″;
        Gtk.Rc.AddDefaultFile(fileName);
        Gtk.Rc.Parse(fileName);

        this.SetSizeRequest(300,300);
        fx=new Fixed();
        fx.HasWindow = true;
        this.Add(fx);
        this.ShowAll();

        gtkrc file:
        style “win”
        {
        bg_pixmap[NORMAL] = “fon.png”
        }
        class “GtkFixed” style “win”

        • mklee 8:41 am on April 2, 2015 Permalink

          Thank you very much.. ㅜㅜ
          I am beginning
          How make gtkrc file?
          and
          Have you ever developed mono modbus salve?
          I nmodbus being developed now
          Sometimes nmodbus is down with exception
          Advice please.

        • huseyincakir 8:45 am on April 2, 2015 Permalink

          Hi,

          A sample gtkrc file exists in project file that I added to dropbox. Sorry :) I have no implementation about mono modbus.

    • mklee 9:37 am on April 2, 2015 Permalink | Reply

      Thank you very much^^
      I got a lot of information through blogs .
      I ask you a lot of information, Please help
      you gkt teacher ^^

    • mklee 8:44 am on April 6, 2015 Permalink | Reply

      hi friend ^^
      You sent me gtkrc3 sample Overall apply
      i made fix1 ,fix2, fix3 Applying the respective other image fixed

      etc..
      fixe1 in label(20 kinds) and fix2(20 kinds) in label applying respective other font size ?
      I want to apply at a time label

      sorry clumsy english .

    • mklee 4:29 am on July 22, 2015 Permalink | Reply

      hi huseyincakir ~

      Do you know how to change image location point?

      etc) c# form img.Location = new Point(40, 40); -> gtk# convert

  • huseyincakir 8:35 am on February 13, 2015 Permalink | Reply  

    Simple Security Precaution: Take picture of person who logins to your pc on logon 

    • CSharp detect logon/logout to Windows PC
    • CSharp capture picture from webcam
    • CSharp send mail attachment
    • Source: https://drive.google.com/file/d/0B5CGxG0MWhPtZ1FUTVJ4YlNyRGc/view?usp=sharing
    • Setting File Example:
      • <?xml version=”1.0″ encoding=”UTF-8″?><ROOT><SYSTEM pathForlogtext=”C:\Users\huseyin.cakir\Desktop\log.txt” pathForlogimage=”C:\Users\huseyin.cakir\Desktop\log.jpg” mailTo=”mailto@gmail.com” mailFrom=”test@gmail.com” mailFromClient=”gmailclientserver” mailFromClientPort=”587″ mailFromUser=”tester” mailSorucePassword=”password”></SYSTEM></ROOT>
    • Screenshots:

    1

    2

    3

     
    • coderDark 3:42 pm on February 13, 2015 Permalink | Reply

      Very nice way :)

      • netherland 11:46 am on February 19, 2015 Permalink | Reply

        Security is the degree of resistance to, or protection from, harm. It applies to any vulnerable and valuable asset, such as a person, dwelling, community, nation, or organization. :D

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 84 other followers