i am very new to this forum and with this technology as well, I need to stream a live video from a multicast IP and need to display it on a website using silverlight player.
The video format is mpeg4. Silverlight player and IIS service is not mendatory if anybody knows any better way to do it than also its fine. Any kind of help will be highly appriciated. Please let me know if i can be more specific about my question.
Just spent too much time debugging code that wouldn't open a file: Have the following line in an if loop
ofdSelect.ShowDialog() == DialogResult.OK
It initially read
ofdSelect.ShowDialog() == DialogResult.Yes
Considering the button on the open file dialog had "Open", can it be assumed than file dialog box will result in OK wheter it is Open or Save, etc.? I couldn't find anything when searching to tell me that an open file dialog will result in OK when the Open button is clicked, but obviously this is the case.
I am seeing some odd behavior in the timer_Elapsed method of a service that I am working on.
(It is an event handler for a System.Timers.Timer instance.)
If I remove the section of code marked "Detect and restore failed FSW objects", the call to "_log.Append" works fine (the _log is an instance of the Logging class described below). However, when that section is included, the "_log.Append" fails to operate. Is it possible that it can prevent the preceeding method call?
Also, everything works fine on Server 2003; this only misbehaves on Server 2008.
///<summary>/// The FileSystem watchers that monitor the specified folders.
///</summary>private List<FileSystemWatcher> _watchers = new List<FileSystemWatcher>();
///<summary>/// Automatic thread correction activity.
///</summary>///<paramname="sender">Sender object.</param>///<paramname="e">Event args.</param>privatevoid timer_Elapsed(object sender, ElapsedEventArgs e)
_log.Append("Timer Cycle started.");
//Detect and restore failed FSW objectstry
if ((from w in _watchers where w.Path == _firewallDirectory.Source select w.Path).Count() == 0)
FileSystemWatcher fw = new FileSystemWatcher(_firewallDirectory.Source);
fw.Created += new FileSystemEventHandler(fsw_Created);
fw.Renamed += new RenamedEventHandler(fsw_Renamed);
fw.EnableRaisingEvents = true;
catch (Exception ex)
_log.Append("ERROR in Timer - FSW Restore: " + ex.Message);
*** FYI: Simple Flat-File Logging Class ***
///<summary>/// Encapsulates logging features for the application.
///<summary>/// Default constructor.
///</summary>///<paramname="Path">The full file path for the log.</param>public Log(string Path)
_logStream = new StreamWriter(Path, true);
#region Private Properties
///<summary>/// The text stream for the file.
///</summary>private StreamWriter _logStream;
#endregion Private Properties
#region Public Methods
///<summary>/// Adds a new line to the end of the log file.
///</summary>///<paramname="LineToAdd">The text to add to the Log.</param>publicvoid Append(string LineToAdd)
_logStream.WriteLine(DateTime.Now.ToString() + " " + LineToAdd);
#endregion Public Methods
1. Although Server 2008 comes with .NET, it is 3.0, not 3.5. 3.5 must be installed via server manager.
2. Because the code (above) involves LINQ (the "from w in _watchers" part), that method will fail without 3.5. However, the rest of the app will run, install, etc.
3. Installing 3.5 fixed all problems. No code changes are needed.
In order to use the break and continue statements, you need to use a for, foreach or while loop - they are illegal elsewhere (ignoring switch statements which would not be helpful to you). If you must use them, then set up a non-terminating while loop (where the condition always evaluates to true) and control the loop execution / exit with break and continue
I can think of no programming exercise for novices where goto should be used at all, with the sole exception of
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy