Find port names10yAsked Aug 30, 2016, 11:46 PM EDT8 answersShareLinkedInXCopy linkSavehello. SerialPort.GetPortNames() method returns null.does not find port names.I try it on Windows 10.Help please.
Find port names10yAsked Aug 30, 2016, 11:46 PM EDT8 answersShareLinkedInXCopy linkSavehello. SerialPort.GetPortNames() method returns null.does not find port names.I try it on Windows 10.Help please.
Vishal JadavRank #1,692 · 901 reputation10y agoPosted Aug 31, 2016, 12:04 AM EDT0Hi,It will work.Try to run your application as Administrator.Hope it helps.If not please let me know.Thanks.0
KBketan borsdiyaRank #2,258 · 624 reputation10y agoPosted Aug 31, 2016, 12:13 AM EDT0Hi Turk,First of all check your pc have port avilable or not?For check available port follow below stepRight click on my computerClick on ManageClick on Device Manager from left paneExpand Ports(COM & LPT)0Rajeesh MenothRank #118 · 18.4K reputation10y agoPosted Aug 31, 2016, 12:18 AM EDT0Hi, Try this code :using System; using System.IO.Ports; namespace SerialPortExample { public class SerialPortExample { public static void Main() { // Get a list of serial port names. string[] ports = SerialPort.GetPortNames(); Console.WriteLine("The following serial ports were found:"); // Display each port name to the console. foreach(string port in ports) { Console.WriteLine(port); } Console.ReadLine(); } } } Reference : https://msdn.microsoft.com/en-us/library/system.io.ports.serialport.getportnames(v=vs.110).aspx Demo : https://dotnetfiddle.net/mDFtPZ0?10y agoPosted Aug 31, 2016, 1:07 AM EDT0hello. Mister VishalI aready gave admin acces on manifest file.But nothing.Mister ketan On Windows 10 on device manager Ports tree is not visible.Mister Rajeesh above I have already described the method which you refer is not working.thanks in advance.0KBketan borsdiyaRank #2,258 · 624 reputation10y agoPosted Aug 31, 2016, 1:17 AM EDT0Windows 10 also display Port tree.While there is not port tree you dont get port names in application.Try to Re - install serial port device driver.0?10y agoPosted Aug 31, 2016, 1:41 AM EDT0Mister Ketan does port tree must be visible serately as on windows 7 or under another title.0KBketan borsdiyaRank #2,258 · 624 reputation10y agoPosted Aug 31, 2016, 2:09 AM EDT0If you show port tree in another tree then post your tree..0?10y agoPosted Aug 31, 2016, 7:13 AM EDT0there are SERIALCOMM folder is missing in registry.could be this reason?0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign inKnow the answer?Answer a question in the forums and earn +20 SHARP for every answer.See unanswered questionsForumsTop experts01Arun PottiAnswers in the forums20answers02Tahir AnsariAnswers in the forums5answers03Kamlesh KumarAnswers in the forums5answers04Sam HobbsAnswers in the forums4answers05Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.JoinFull leaderboard →2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajeesh MenothRank #118 · 18.4K reputation10y agoPosted Aug 31, 2016, 12:18 AM EDT0Hi, Try this code :using System; using System.IO.Ports; namespace SerialPortExample { public class SerialPortExample { public static void Main() { // Get a list of serial port names. string[] ports = SerialPort.GetPortNames(); Console.WriteLine("The following serial ports were found:"); // Display each port name to the console. foreach(string port in ports) { Console.WriteLine(port); } Console.ReadLine(); } } } Reference : https://msdn.microsoft.com/en-us/library/system.io.ports.serialport.getportnames(v=vs.110).aspx Demo : https://dotnetfiddle.net/mDFtPZ0
?10y agoPosted Aug 31, 2016, 1:07 AM EDT0hello. Mister VishalI aready gave admin acces on manifest file.But nothing.Mister ketan On Windows 10 on device manager Ports tree is not visible.Mister Rajeesh above I have already described the method which you refer is not working.thanks in advance.0
KBketan borsdiyaRank #2,258 · 624 reputation10y agoPosted Aug 31, 2016, 1:17 AM EDT0Windows 10 also display Port tree.While there is not port tree you dont get port names in application.Try to Re - install serial port device driver.0
?10y agoPosted Aug 31, 2016, 1:41 AM EDT0Mister Ketan does port tree must be visible serately as on windows 7 or under another title.0
KBketan borsdiyaRank #2,258 · 624 reputation10y agoPosted Aug 31, 2016, 2:09 AM EDT0If you show port tree in another tree then post your tree..0
?10y agoPosted Aug 31, 2016, 7:13 AM EDT0there are SERIALCOMM folder is missing in registry.could be this reason?0
Vishal JadavRank #1,692 · 901 reputationPosted Aug 31, 2016, 12:04 AM EDT
ketan borsdiyaRank #2,258 · 624 reputationPosted Aug 31, 2016, 12:13 AM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Aug 31, 2016, 12:18 AM EDT
Posted Aug 31, 2016, 1:07 AM EDT
Mister Vishal
ketan borsdiyaRank #2,258 · 624 reputationPosted Aug 31, 2016, 1:17 AM EDT
Posted Aug 31, 2016, 1:41 AM EDT
ketan borsdiyaRank #2,258 · 624 reputationPosted Aug 31, 2016, 2:09 AM EDT
Posted Aug 31, 2016, 7:13 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts