Click here to Skip to main content
16,005,054 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
R/S
I want to ask how can I check which player is playing in my system?
actually I have to create an application which should detect which player is playing on the system.

thanks in advance

Can you please give me some weblink demonstrating how to use Process.GetProcessbyName. in c# .net application
Posted
Updated 12-Jun-11 7:10am
v3

The class System.Diagnostics.Process.GetProcessByName won't give you anything. First, it will be the same process name no matter who is playing. Secondly, this is unreliable: two completely different and unrelated processes can accidentally get the same name. See http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[^]. This is the only Web link you really need. :-)

I would suggest you simply introduce player authentication inside your application. This is a usual practice.

—SA
 
Share this answer
 
Comments
Tarun.K.S 12-Jun-11 16:13pm    
5+. But SA, is it possible to detect the player that is playing in one's system? I think it will require some more work.
Sergey Alexandrovich Kryukov 12-Jun-11 16:18pm    
Thank you, Tarun.
I agree about some more work. My advice in the second paragraph assume playing in one system or different on remote -- does not matter. Authentication is authentication.
--SA
Check out this link[^]. It will lead you to other useful links.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 12-Jun-11 16:04pm    
This is a correct link, but it won't help (I voted 4).
Please see my solution.
--SA
Tarun.K.S 12-Jun-11 16:11pm    
Thank you SA! :)
You can't really do that effectively. There's dozens of players out there. The only way to detect which is running in to know the filename of every player you want to support, then check the list of process' returned by Process.GetProcessbyName.
 
Share this answer
 
Comments
[no name] 12-Jun-11 12:17pm    
Can you please give me some weblink demonstrating how to use Process.GetProcessbyName. in c# .net application
Sergey Alexandrovich Kryukov 12-Jun-11 16:04pm    
You don't need it. Please see my solution.
--SA
Dave Kreskowiak 12-Jun-11 16:47pm    
No wonder your on the Top 24 all the time. You spend half your time criticizing everyone elses answers.

As for your solution, he didn't give enough specifics about what his app was doing. All he asked was how he could tell which player was running. I fail to see how authentication would tell you which player is running.
Sergey Alexandrovich Kryukov 12-Jun-11 16:05pm    
What's "filename of every player"? (I did not vote this time.)
Please see my solution.
--SA
Dave Kreskowiak 12-Jun-11 16:49pm    
Every player has it's own filename. Whether those filenames are duplicates doesn't matter (to me anyway.) So, how is authentication going to tell you which player is playing the content? Mind you, his question sounds grounded in WinForms, not ASP.NET.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900