前几天我开始用c#做一个adsl的拨号程序,就在论坛的搜索中搜索"拨号"结果出来一大堆关于拨号的内容,有的朋友给贴出来了源码(很感谢这些热心的朋友),但我发现的问题是,有很多人提出用了这些源码后,不能自动拨号,只是调出拨号的窗体,还需人工点击拨号才能用,(本人也在测试的时候出现了同样问题没有解决)我想这可能是一个普遍的问题有很多问题贴都没有解决,所以恳请mvp,版主们能够对这类的问题进行集中的解决.谢谢你们了.
解决方案 »
- PropertyGrid(Ex)如何增加一个可点击的button?
- C#读取USE KEY
- c#写的电子邮件接收 有问题,请各位大虾帮忙!!!
- 又一次活见鬼了(不重新编译??!!)
- 如何将一个字节数组保存为二进制文件????
- 请教一下会话的生命周期问题
- 请问一下那位大哥会用.Net打包程序,就是先判断windows下有没有msde,在有就是判断一下有没有.NET Framework,最后在安装自己的程序!
- 难啊!!大家来看:各位大大有没有办法用线程启动一个IE实例
- 求助:TCPClient NetworkStream 使用问题
- 最近使用sina微博的api:https://api.weibo.com/2/statuses/upload.json时,需要使用post请求发送二进制图片,不
- using Microsoft.Office.Interop.Excel; 怎么老是报错?
- 送分给会正则的朋友
EntryPoint = "InternetGetConnectedState", ExactSpelling = true,
CharSet = System.Runtime.InteropServices.CharSet.Ansi,
SetLastError = true)]
private static extern bool InternetGetConnectedState(ref Int32
lpdwFlags, Int32 dwReserved); [System.Runtime.InteropServices.DllImport("Wininet.dll",
EntryPoint = "InternetDial", ExactSpelling = true,
CharSet = System.Runtime.InteropServices.CharSet.Ansi,
SetLastError = true)]
private static extern Int32 InternetDial(IntPtr hwndParent, string
lpszConnectoid, Int32 dwFlags, ref Int32 lpdwConnection, Int32
dwReserved); [System.Runtime.InteropServices.DllImport("Wininet.dll",
EntryPoint = "InternetHangUp", ExactSpelling = true,
CharSet = System.Runtime.InteropServices.CharSet.Ansi,
SetLastError = true)]
private static extern Int32 InternetHangUp(Int32 lpdwConnection,
Int32 dwReserved); private enum Flags : int
{
//Local system uses a LAN to connect to the Internet.
INTERNET_CONNECTION_LAN = 0X2,
//Local system uses a modem to connect to the Internet.
INTERNET_CONNECTION_MODEM = 0X1,
//Local system uses a proxy server to connect to the Internet.
INTERNET_CONNECTION_PROXY = 0X4,
//Type Visual Basic 6 code here... //Local system has RAS installed.
INTERNET_RAS_INSTALLED = 0X10
} //Declaration Used For InternetDialUp.
private enum DialUpOptions : int
{
INTERNET_DIAL_UNATTENDED = 0X8000,
INTERNET_DIAL_SHOW_OFFLINE = 0X4000,
INTERNET_DIAL_FORCE_PROMPT = 0X2000
} private const int ERROR_SUCCESS = 0X0;
private const int ERROR_INVALID_PARAMETER = 0X87;
可以自动拨号....[/code]
1,使用代码调用ADSL拨号的程序,然后进行拨号(使用的是InternetDial)如果想自动拨号,把拨号属性里的选项标签里的显示连接进度和提示名称,密码取消后就可以实现自动拨号了。但弱点程序操作麻烦。2,就是把InternetDial替换成InternetAutoDial就可以自动拨号了。对于ericzhangbo1982111给的这个程序我想就是靠wininet的参数把第一条里的显示连接进度和提示名称,密码取消的,(具体没有差参数说错了不要介意哈)