• Navigation
+ Reply to Thread
Results 1 to 15 of 15
  1. #1
    Hyperion Cross
    Join Date
    Jan 2007
    Posts
    8,084
    BG Level
    8
    FFXIV Character
    Kai Bond
    FFXIV Server
    Gilgamesh

    I want to create a very simple ping app that'll sit in the system tray with colour codes

    Any quick pointers on how I can quickly churn one out?

    The primary purpose of this is to tell users (whom are working from home) if their ping/response times are unreasonable.

    I want to make an app that will:

    1. Sit in the system tray only, maybe will quit itself if I right click and select exit
    2. Ping a predefined address every second (nevermind the possibility of creating traffic, I've been told not to worry about this)
    3. If ping is good, display a green icon. If ping is average, display orange, if ping is shit or none existance, red icon.
    4. All in the system tray. Maybe taking a predefined ini or cfg file of where to ping and taking the threshoulds from there. Running on Windows 7 primarily and all the way back to XP (but we're looking to phase it out).

    Logically I can work out in my head on how to code it (if it's in say, PHP), but as I don't make programs for windows I have little to no idea where to start, it's not my specialty. But given the simplicity I don't think it should be that difficult?

    Googling takes me to creating my own ping pong table

    EDIT: I've googled around for similar, all of them are either shit, or too complex in a sense that it allows users to modify more settings, or too simple... this is quite difficult lol

  2. #2
    Sea Torques
    Join Date
    Oct 2006
    Posts
    566
    BG Level
    5
    FFXI Server
    Sylph

    On phone with TappyTalk so I can't actually code it, but the easiest way would probably be to grab Visual Studio 2012 Express and make a C# application.

    You'd basically need to set up a timer that pings every X account of time, them use the PingReply object to get information about the response time.

    http://msdn.microsoft.com/en-us/libr...tion.ping.aspx
    http://msdn.microsoft.com/en-us/libr...pingreply.aspx

    Terrible phone code below. If no one else replies before I get home, I can give a better example.

    Code:
    Ping ping = new Ping();
    
    try
    {  
    PingReply reply = ping.Send(HOST);
              if (reply.Status == IPStatus.Success)
              {            
                // Ping successful
              }
              else
              {
                // Ping failed
              }
            }
            catch(Exception ex)
            {
              // Something else
            }

  3. #3
    Banned.

    Join Date
    Oct 2006
    Posts
    10,159
    BG Level
    9

    Visual studio express or most cheap compiler with win8 support works.

  4. #4
    Relic Shield
    Join Date
    Nov 2004
    Posts
    1,553
    BG Level
    6
    FFXI Server
    Bahamut

    Why not have them use a VPN? >.>

  5. #5
    Hyperion Cross
    Join Date
    Jan 2007
    Posts
    8,084
    BG Level
    8
    FFXIV Character
    Kai Bond
    FFXIV Server
    Gilgamesh

    Thanks for the quicky reply!! The good thing is I do have Visual Studio 2012 (or 2008) which I can use.

    I'll quickly research those 2 links, but it seems everything I need is there.

    The final thing is just trying to get my head around how this will sit in as an application with 3 colour icons and lives in the system tray only. But I guess for simplicity reasons I would dump the output as a window message just to prove it works.

    Why not have them use a VPN? >.>
    EDIT: So sorry, 2 replies were generated as I replied. They do use a VPN but they've noticed that when connecting using wifi the response times goes stupidly high at random times (imagine getting R0 in FFXI constantly). But plug in an ethernet cable and it's all fine and dandy. No one knows why, and I've been suggested to hunt a solution that would not fix the problem, but tell users when to plug in an ethernet cable (apparently, some are too dumb to tell it's slow from general usage alone, so an icon will help prompt them to do so)

    Believe me this is for the absolutely none IT people lol, so as retarded as this seems, the people who are making decisions on this thinks it's the best way to go.

  6. #6
    Banned.

    Join Date
    Oct 2006
    Posts
    10,159
    BG Level
    9

    The wizards and properties window have most anything to put the app in the systray.
    I can try and churn some crappy app when I reach the of. In about.. 1.5hrs. You should be done way before that tho lol

  7. #7
    Hyperion Cross
    Join Date
    Jan 2007
    Posts
    8,084
    BG Level
    8
    FFXIV Character
    Kai Bond
    FFXIV Server
    Gilgamesh

    Actually I don't think I can be done that quick haha. I work quite best if I have a working example and try to reverse engineer it/enhance it. However, please don't consume your time doing so as I don't have much of a possible reward for it, but rather just pointers or a template I can analyse and work off from. I'm actually logging on to various servers at the moment looking for visual studio lol -- I used it a while back on a mini project but I can't locate it yet.

    However, if you do make one, it would be a good learning experience overall as it means I can maybe make more "simple" things in the future.

  8. #8
    Banned.

    Join Date
    Oct 2006
    Posts
    10,159
    BG Level
    9

    Fuck rewards, its easy to get running. "Hardest" part is changing the color lol, as I havent done that before.

  9. #9
    Hyperion Cross
    Join Date
    Jan 2007
    Posts
    8,084
    BG Level
    8
    FFXIV Character
    Kai Bond
    FFXIV Server
    Gilgamesh

    I see. Assuming that this program won't consume a lot of resources, can't you just stick it on constant loop in such a way that if the response time is greater than 10ms (for now) then it will display X colour, and so on. Or do safety measures prevent an app from running on infinite loop?


    I spoke to a more senior person here, it turns out it's Visual Studio 2005 that we have, I hope it can open 2008/2012 items lol
    So now I'm thinking of alternative tech, like a web page that a user can quickly launch and perform the ping. Looking at the tech available it seems I can do something similar in PHP, so I'm currently exploring this.

  10. #10
    Banned.

    Join Date
    Oct 2006
    Posts
    10,159
    BG Level
    9

    Working on it. i'm making it in framework 2.0 but should be the same logic Can just download an express edition and make it work.

  11. #11
    Banned.

    Join Date
    Oct 2006
    Posts
    10,159
    BG Level
    9

    Here you go stiggy boy. hope it works
    https://dl.dropboxusercontent.com/u/...9/TrayPing.rar

    So yeah, took me a while to figure out how to minimize the shit to the system tray, rest was cake.

  12. #12
    Hyperion Cross
    Join Date
    Jan 2007
    Posts
    8,084
    BG Level
    8
    FFXIV Character
    Kai Bond
    FFXIV Server
    Gilgamesh

    Ooooo I look forward to it!

    At the moment it's 4:36pm here, and I leave in approx 45 mins or maybe more. So there's that chance where I won't be able to dabble with it until Monday (not saying you should hurry up or that I twink with it over the weekend)

    On the bright side, I got Visual Express 2010 working again. I thought we only had the trial Pro version installed, but the Express edition was hidden away. After re-getting the license key and opening an old project of mine, I'm back in familiar ground! I thought it looked weird/unfamiliar in Studio 2005 so I temporarily gave up at the time, then returned to one of my other servers to find it sitting there.

    EDIT: Wow that was quick. Lets play! (I replied before seeing your reply)

    ---

    Haha this is well cool! So is it right to assume I should open TrayPing.sln on the root to be able to modify and compile it?
    On my older project I got a app_name.vbproj file which is the only one I needed to open to be able to access all the files/objects/resources in the app.
    Unfortunately at the moment when I try to open TrayPing.sln with Visual Basic 2010 Express it says the file was created with a newer version and cannot be opened
    I can view the other files fine and run the debug one no prob, but I'm unable to actually recompile it at the moment. Still exploring, still noob at it.

    I'm just having a poke around Microsoft to see if there's a newer one at the moment.

    Balls there is a 2012 edition. Downloading!
    And I see why I had to get a license:

    After installation, you can try this product for up to 30 days. You must register to obtain a free product key for ongoing use after 30 days.
    EDIT3: I doubt it's a 2013 edition (preview) you've created this in XD

  13. #13
    Banned.

    Join Date
    Oct 2006
    Posts
    10,159
    BG Level
    9

    You can create a new C# project (Windows Forms application) in VS2010, select netframework 2.0 and then pretty much paste the code files on top of the ones Vs creates for you.

    I can put in in vs2010 if you want, just kinda lazy to fire up the Virtual machine

  14. #14
    Hyperion Cross
    Join Date
    Jan 2007
    Posts
    8,084
    BG Level
    8
    FFXIV Character
    Kai Bond
    FFXIV Server
    Gilgamesh

    I'll try that, at the same time I've got 2012 installing! Don't worry about the VM yet. Only if I get desperate. I decided not to go home, gonna see if I can get a breakthrough here.

    EDIT: Thanks for your efforts Tajin, I'm going to head home now, the download here of that app is sloooowwww. I'm going to work on my super PC at home. I suspect it won't take long at all to tweak and work out what's going on, but the work PCs are proving impossible.

    Oh, ironically, I noticed that VS2010 and VB2010 are different ... no wonder I couldn't find the C# option in the new project bit. Still, I need time at home to tinker on a fast PC. The work ones don't cut it.

  15. #15
    Banned.

    Join Date
    Oct 2006
    Posts
    10,159
    BG Level
    9

    Do send me a PM if you get stuck