Welcome Guest.   Make a donation to an author on the site December 22, 2014, 08:57:06 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2013! Download dozens of custom programs!
   
  Forum Home Thread Marks Chat! Downloads Search Login Register  
  Show Posts
      View this member's profile 
      donate to someone Donate to this member 
Pages: [1] 2 3 4 5 6 ... 10 Next
1  Other Software / Developer's Corner / Re: Announcing with UDP in C# - Punching above my weight on: May 03, 2011, 10:42:17 AM
Quote
Sorry if I get a little Captain Obvious here, but are you sure the request packet is being replicated exactly?
It's the same as the WireShark capture, but past that I can't be 100%.

I've certainly given up on this, so don't spend any more time on it. Once the announce works I've got to query the box for the channels all while programming on a subnet that doesn't actually have the boxes on it.

This project is where an attitude of 'fail quickly and adapt' is working well. The C# application to use the Wireshark data works well enough for how little it would be used.

Thanks all

Graham
2  Other Software / Developer's Corner / Re: Announcing with UDP in C# - Punching above my weight on: May 03, 2011, 05:16:44 AM
Thanks Jazper,
You code confirms what I've previously found. It seems quite easy and reliable to get the router you are connected to to respond to these types of broadcasts but the more unreliable and inconsistent IPTV systems seem to lock up the .Receive commands.

In the end I've been using Wireshark and monitoring the responses of a propriety IPTV multicast program. I then export the filtered Wireshark output into a C# application to get all the channels.

Formatted for C# with the GeSHI Syntax Highlighter [copy or print]
  1. // Please excuse the fact that I found out it was called 'Wireshark' about half way through and then
  2. // couldn't be bothered fixing the function names
  3. private void btnOpenWireShackFile_Click(object sender, EventArgs e)
  4.        {
  5.            MessageBox.Show("Remember to select the Wireshark \"K12 Text File\" that you have saved with " +
  6.                "the filter 'sap.flags' (no apostrophes) and save \"Packet Range: Displayed\" and \"All packets\"",
  7.                "Instructions", MessageBoxButtons.OK, MessageBoxIcon.Information);
  8.  
  9.            btnSave.Enabled = false;
  10.  
  11.            openWireshackTxtFile.Title = "Choose wireshark txt file";
  12.            openWireshackTxtFile.Filter = "TXT Files|*.txt";
  13.  
  14.            if (openWireshackTxtFile.ShowDialog(this) == DialogResult.OK)
  15.            {
  16.                strWireSharkFileLocation = openWireshackTxtFile.FileName;
  17.  
  18.                replaceBigTextBox("");
  19.                replaceM3UTextBox("");
  20.  
  21.                Thread threadReadHex = new Thread(readHexAndOutputASCII);
  22.                threadReadHex.IsBackground = true;
  23.                threadReadHex.Start();
  24.            }
  25.        }
  26.  
  27.        private void readHexAndOutputASCII()
  28.        {
  29.            if (strWireSharkFileLocation == "VOID")
  30.            {
  31.                return;
  32.            }
  33.  
  34.            try
  35.            {
  36.                strWireSharkFile = File.ReadAllLines(strWireSharkFileLocation);
  37.            }
  38.            catch
  39.            {
  40.                MessageBox.Show("Failed to open Wireshack file", "Fatal error",
  41.                    MessageBoxButtons.OK, MessageBoxIcon.Error);
  42.                return;
  43.            }
  44.  
  45.            replaceM3UTextBox("#EXTM3U\r\n");
  46.  
  47.            int i = 1;
  48.            int j = 0;
  49.  
  50.            foreach (string line in strWireSharkFile)
  51.            {
  52.                if (line.Length > 2 && line.Substring(0, 2) == "|0")
  53.                {
  54.                    string[] characters = line.Split('|');
  55.                    string completeLine = "";
  56.  
  57.                    foreach (string hex in characters)
  58.                    {
  59.  
  60.                        if (hex.Length == 2)
  61.                        {
  62.                            try
  63.                            {
  64.                                int n = Convert.ToInt32(hex, 16);
  65.                                if (n >= 32 && n < 255)
  66.                                {
  67.                                    char c = (char)n;
  68.                                    completeLine += c.ToString();
  69.                                }
  70.                                else if (n == 10)
  71.                                {
  72.                                    completeLine += "|";
  73.                                }
  74.                            }
  75.                            catch
  76.                            {
  77.                                // Do we need to do anything here?
  78.                            }
  79.                        }
  80.                    }
  81.  
  82.                    addToBigTextBox(completeLine.Replace("|", "\r\n") + "\r\r\n");
  83.  
  84.                    string[] partLine = completeLine.Split('|');
  85.  
  86.                    foreach (string data in partLine)
  87.                    {
  88.  
  89.                        if (data.Length > 3 && data.Substring(0, 2) == "s=")
  90.                        {
  91.                            string channelName = data.Substring(2, data.Length - 2);
  92.                            addToM3UTextBox("#EXTINF:" + i + "," + channelName + "\r\n");
  93.                        }
  94.  
  95.                        if (data.Length > 3 && data.Substring(0, 2) == "c=")
  96.                        {
  97.                            string nospacedata = data.Replace(" ", "");
  98.                            string[] splitip = nospacedata.Split('/');
  99.                            string ip = splitip[0].Substring(7, splitip[0].Length - 7);
  100.                            addToM3UTextBox("udp://" + ip + ":5000" + "\r\n");
  101.                        }
  102.  
  103.  
  104.                    }
  105.                    decimal deProgressBar = (((decimal)j + 1) / (decimal)strWireSharkFile.Length) * 100;
  106.                    intProgressBar = (int)Math.Ceiling(deProgressBar);
  107.                    changeProgressBar();
  108.                    i++;
  109.                }
  110.                j++;
  111.            }
  112.            intProgressBar = 100;
  113.            changeProgressBar();
  114.        }
3  Other Software / Developer's Corner / Re: Announcing with UDP in C# - Punching above my weight on: April 27, 2011, 12:52:25 PM
Thanks Joker
4  Other Software / Developer's Corner / Re: Announcing with UDP in C# - Punching above my weight on: April 27, 2011, 10:37:13 AM
LAN.

I'm working my way through the example code I linked above and was wondering if anyone else had seen any code like it. I suppose it really was a shot in the dark.

This is the kind of code I'm after

Formatted for C# with the GeSHI Syntax Highlighter [copy or print]
  1. public static bool Discover()
  2.        {
  3.            Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
  4.            s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
  5.            string req = "M-SEARCH * HTTP/1.1\r\n" +
  6.            "HOST: 239.255.255.250:1900\r\n" +
  7.            "ST:urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\n" +
  8.            "MAN:\"ssdp:discover\"\r\n" +
  9.            "MX:3\r\n\r\n";
  10.            byte[] data = Encoding.ASCII.GetBytes(req);
  11.            IPEndPoint ipe = new IPEndPoint(IPAddress.Broadcast, 1900);
  12.            byte[] buffer = new byte[0x1000];
  13.  
  14.            DateTime start = DateTime.Now;
  15.  
  16.            Console.WriteLine("Starting do while < timeout");
  17.            do
  18.            {
  19.                s.SendTo(data, ipe);
  20.                s.SendTo(data, ipe);
  21.                s.SendTo(data, ipe);
  22.  
  23.                int length = 0;
  24.                do
  25.                {
  26.                    length = s.Receive(buffer);
  27.                    string resp = Encoding.ASCII.GetString(buffer, 0, length).ToLower();
  28.                    Console.WriteLine(resp);
  29.                } while (length > 0);
  30.            } while (start.Subtract(DateTime.Now) < _timeout);
  31.            return false;
  32.        }
  33. }
5  Other Software / Developer's Corner / Announcing with UDP in C# - Punching above my weight on: April 27, 2011, 09:38:33 AM
Hi all,
I've got a multicast IPTV system where I work and a piece of software, which no longer works in Windows 7, discovers what channels are available using SSDP. I was hoping to write a short console application that would annouce itself and then wait for replies.

My programming skills lend themselves to manipulating online examples to do what I want, but I'm having trouble finding any example code for this type of thing, this being the only example I can find - http://www.codeproject.co...versal.aspx?display=Print . I was wondering if anyone knew of anything else out there?
6  Other Software / Found Deals and Discounts / Re: Windows 7 Pro Academic Discount on: April 27, 2011, 08:22:00 AM
The British price is strange. The American version stays quite constant during the year, but the british goes down to £29.99 between about September and November and then returns to £79.99 for the rest of the year.
7  Other Software / Developer's Corner / onsubmit doesn't work in IE on: March 14, 2011, 05:09:14 PM
Hi all,
I'm getting confused by a problem. Everything works fine in Firefox, but in IE I can't get a form to submit correctly with the enter key.

I have this function

Formatted for Javascript with the GeSHI Syntax Highlighter [copy or print]
  1. function enter()
  2. {
  3. if (step == 7)
  4. {
  5. return true;
  6. }
  7. else
  8. {
  9. next();
  10. return false;
  11. }
  12. }

and this line of code

Formatted for HTML with the GeSHI Syntax Highlighter [copy or print]
  1. <form id="form" name="form" method="post" action="upload.php" onsubmit="return enter();">

But enter() never seems to load until you get to a real submit button. I've put the entire code here - http://www.unics.co.uk/onsubmit/

Does anyone know what might be the issue?
8  Main Area and Open Discussion / Living Room / Re: The March 2011 6th Anniversary Fundraiser Has Begun! Cheer for Victory Thread on: March 01, 2011, 08:48:58 AM
I've not really been around this site in the last 12 months. Here's to improving that  Thmbsup
9  Other Software / Developer's Corner / Re: Is it easy to send a request to http://IP?password and make something happen? on: August 10, 2010, 02:04:45 AM
That looks amazing. I'll try and check it out over the next few days.

Thanks skwire
10  Other Software / Developer's Corner / Re: Is it easy to send a request to http://IP?password and make something happen? on: August 09, 2010, 07:48:07 AM
Apologies for the late reply.

I don't actually need to download anything, just to get the computer to display the image. So the computer should be listening for a command, and when it gets it it will display an image on the screen of the computer.

It's one of those things that seems hard to say and harder to actually get working. I was just wondering if one of the geniuses here had seen something around.

Thanks
Graham
11  Other Software / Developer's Corner / Is it easy to send a request to http://IP?password and make something happen? on: August 03, 2010, 11:42:28 AM
Hi clever people.

I work in a University. In our lecture theatres we have a touch screen that makes all the equipment work, a computer and a projector (as well as other bits we can ignore).

We've been asked to make a button on the touchscreen that makes a picture appear on the projector. There are some expensive ways around this but the cheapest would be the following

Press button on touch panel > Touch panel sends a GET to the computer > The computer is listening for this GET and when it recieves it, it shows a picture.

Is this easy to do? Or does it involve running web servers on computers. I.e. can I write a simple c# program that says 'wait for this command on port 1337'?
12  Other Software / Developer's Corner / Re: AHK Newbie: SendInput to a particular process on: May 10, 2010, 10:26:38 AM
Thanks, that's the perfect command.

Do you see why this doesn't work?
[copy or print]
#2::
Run, C:\Windows\System32\notepad.exe, , , notepad1pid
Run, C:\Windows\System32\notepad.exe, , , notepad2pid
Sleep, 500
ControlSend, notepad1pid, Hello Notepad 1
ControlSend, notepad2pid, Hello Notepad 2
return
13  Other Software / Developer's Corner / AHK Newbie: SendInput to a particular process on: May 10, 2010, 09:47:31 AM
Hi all,
I've just written a very simple AHK script to load up VNC and then log into a PC, open IE, go to a website and login. The trouble is that if I click off the window it all breaks.

Is there a way of sending keys to a particular process (and if so how to find the process)? The process is started by AHK in the script.

Thanks

Graham
14  Main Area and Open Discussion / Living Room / Re: KVM switch woes -- any recommendations? on: May 09, 2010, 05:15:55 AM
If your monitor has two inputs on it then multiplicity is very good.
15  Main Area and Open Discussion / General Software Discussion / Re: Default audio settings on: March 26, 2010, 01:17:32 PM
I just wanted to thank you for the link. It's a shame that the program doesn't seem to work with Win 7.
16  Main Area and Open Discussion / General Software Discussion / Default audio settings on: March 25, 2010, 02:18:00 PM
Does anyone know of a program that will remember a audio setting (default playback / recording device, levels, mute settings, etc) and will automatically set them each time it loads?

I'm also looking for a levels meter that can sit in the system tray or desktop. Can anyone help me out?
17  Main Area and Open Discussion / Living Room / Re: Watch a game instead of playing it - NextgenWalkthroughs.com and others? on: March 10, 2010, 02:12:24 PM
Well I'm 3 hours into Metal Gear Solid 4 now. Thanks for the link
18  DonationCoder.com Software / Screenshot Captor / Re: No disc in Drive D on: March 01, 2010, 08:02:26 AM
I don't think so. I'm running Windows 7 Enterprise 64 bit on a domain, Sophos as the anti virus, no anti-malware, windows firewall. I'm an admin and setup prompted me to run as an administrator.
19  DonationCoder.com Software / Screenshot Captor / Re: No disc in Drive D on: March 01, 2010, 05:54:30 AM
I don't have a donationcoder folder in my My Documents folder (\\soton.ac.uk\ude\PersonalFiles\Users\gra\mydocuments) nor anywhere else I can think of (C:\Users\gra\Documents)
20  DonationCoder.com Software / Screenshot Captor / Re: No disc in Drive D on: March 01, 2010, 05:43:24 AM
Where is it?
21  DonationCoder.com Software / Screenshot Captor / No disc in Drive D on: March 01, 2010, 05:36:23 AM
Hi Mouser,
I upgraded my work computer to Windows 7 last week and I've just installed SC. The trouble is after I install (to C:\Program Files (x86)\ScreenshotCaptor) I get 4-5 error messages appear saying

"There is no disk in the drive. Please insert a disk into drive D:"

D is my CD drive. I've uninstalled and re-installed. My shortcut points to "C:\Program Files (x86)\ScreenshotCaptor\ScreenshotCaptor.exe", the program occasionally says 'no timers availble' and I cannot use it.

Can you think what the problem is?
22  Main Area and Open Discussion / General Software Discussion / Re: Monster Cables- The World should know! on: February 03, 2010, 04:28:50 AM
http://news.bbc.co.uk/new...sid_10056500/10056547.stm

I have to admit that it takes a lot of time to educate the whole world! Grin

Even that article isn't too reassuring. Budget 10% of your system money for a cable? So if I buy a $4,000 HDTV I'm supposed to budget $400 for the HDMI cable?

I'd rather stick to MonoPrice. A $5 HDMI cable suits me just fine. Unless I can get it for less. (c;

Richer sounds always used to quote 10% for cabling but that was because of all the composite and speaker cables that have to go between everything. 10% between two devices seems a bit excessive.
23  Main Area and Open Discussion / Living Room / Re: Just how many Hitler videos does the world need? on: February 02, 2010, 05:56:14 AM
I've got this film on my streaming server and I found it interesting to read what he was actually saying.

Got to admit that I really love them. Especially the ones that actually use the word 'Stalin' in the translations.  Kiss
24  Other Software / Found Deals and Discounts / Bioshock 2 with free Bioshock on: January 22, 2010, 01:57:58 AM
(I don't know what this deal is like for non UK)

Steam seem to have (or have ingeniously designed) a mistake on the pre-order of BioShock 2. Their full price is £39.99 and currently have a pre-order offer of 10% off making it £25.99. Now my maths isn't great but I think that 40 - (10% of 40 = 4) = 36. So take them up on the offer while it is there.

During the pre-order they are giving away BioShock 1 for pc. I already have it so if someone wants it for a few donation credits (which I've run out of but want to give to skwire) than let me know.

Graham
25  Special User Sections / N.A.N.Y. 2010 / Re: NANY 2010 Release: Anuran on: January 20, 2010, 08:17:25 AM
You may know about this but the program is causing the 'return' key to be a carriage return before it is a 'ok' command.

This doesn't cause too many problems normally, just an extra line in the AnVu software. However if you remember the last entry it means that the cursor starts underneath the sentence the next time it appears. It also means that if you remove something from the beginning of the sentence you end up with blank lines

   (2010-01-20 @ 01:10:49 PM)
      Lunch
      
      
      
   (2010-01-20 @ 01:41:14 PM)
      Tickets and VHS digitisation
 
 
 
   (2010-01-20 @ 02:11:18 PM)
      
      VHS digitisation
      


I think this is the following

   (2010-01-20 @ 01:41:14 PM)
      Tickets and VHS digitisation
[blank line added by fault in return key]
[blank line added by AnVu at the end of message]      
[blank line added by AnVu at the start of the next message]
   (2010-01-20 @ 02:11:18 PM)
[blank line as I removed 'Tickets and' and pressed Enter   ]
      VHS digitisation
      
Pages: [1] 2 3 4 5 6 ... 10 Next
DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.093s | Server load: 0 ]