如何限制谁可以连接到我的Socket应用程序 [英] How to restrict who can connect to my Socket application

查看:52
本文介绍了如何限制谁可以连接到我的Socket应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我真的需要C#的紧急和友好的帮助.我几乎想死以后就设法使用TCPListener创建Socket应用程序,但是现在的问题是,当我的机器位于tcpListener中指定端口的同一网络telnet内的任何人都可以连接时.它不安全,所以我创建了一个函数来询问用户密码.但是我不知道当用户键入密码时如何隐藏密码.诸如******之类的内容,或者不显示用户输入的内容.请上帝保佑我.我是应届毕业生,不想失去工作.我如何隐藏用户键入的密码.还是有办法确保我的套接字应用程序安全,只有那些使用SSH登录到我的计算机的人才能通过telnet我的套接字应用程序.我希望你明白我的意思.我真的是编程新手,可能不知道怎么问问题.帮助meeeeeeeeeeeeeeeeeeeee

Hi,

I really need an urgent and kind help in C#. I have managed after almost like dying to create Socket application using TCPListener but now the issue is when anyone within the same network telnet my machine at the specified port in my tcpListener, can be connected. It is not secured, so i created a function to ask user for password. But i don''t know how can i hide the password when the user type it. something Like ****** or don''t show what the user is typing. Please, with GOD''s mercy help me. I''m fresh graduate and don''t want to loose my job. How can i hide the password typed by the user. Or is there anyway to make my socket application secured where only those who logged in to my machine using SSH can telnet my socket application. I hope you understand what i mean. I''m really new to programming and might not know how to ask question. Help meeeeeeeeeeeeeeeeeee

推荐答案

如果您使用Windows窗体应用程序,则文本框控件具有PasswordChar属性,将该属性设置为要使用的任何符号,或者设置UseSystemPasswordChar属性为true时使用,因为您可能会猜到系统默认符号.
If you are using a windows forms application, the textbox control has a PasswordChar property, set that to whatever symbol you want to use, OR set the UseSystemPasswordChar proptery to true to use as you may guess the systems default symbol.


这篇关于如何限制谁可以连接到我的Socket应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆