主窗口一个textbox与btnstart按钮

代码是使用别人!只是去掉部分不用的!只用于拨号!用于辅助打电话!

form1

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.Drawing;

using System.Threading;

namespace DialUp
{
    public partial class Form1 : Form
    {
        static String str11;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (btnStart.Text == "开始")
            {

                str11 = textBox1.Text;
                btnStart.Text = "停止";
                timer2.Enabled = true;

                int ModemCount = int.Parse(GetConfig("ComCount"));
                ; i < ModemCount; i++)
                {
                    queue.Enqueue(i + );
                }
            }
            else
            {
                btnStart.Text = "开始";
                timer2.Enabled = false;

                )
                {
                    try
                    {
                        Thread t = queueThread.Dequeue();
                        t.Join();
                        t.Abort();
                    }
                    catch { }
                }
            }
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
            )
            {
                Thread t = new Thread(Dial);
                t.Start();

                queueThread.Enqueue(t);
            }
        }
        /// <summary>任务队列</summary>
        private static System.Collections.Generic.Queue<int> queue = new Queue<int>();
        /// <summary>线程队列 </summary>
        private static System.Collections.Generic.Queue<Thread> queueThread = new Queue<Thread>();
        private static System.Text.StringBuilder sbMsg = new StringBuilder();
        private static void Dial()
        {
            int index = queue.Dequeue();
            sbMsg.Insert(, "启动端口" + index + "\r\n");

            try
            {

                CommPort port = new CommPort();
                port.PortNum = GetConfig(string.Format("Com_{0}_PortNum", index));//端口名称
                port.BaudRate = int.Parse(GetConfig(string.Format("Com_{0}_BaudRate", index)));             //串口通信波特率 ,每秒位数
                port.ByteSize = byte.Parse(GetConfig(string.Format("Com_{0}_ByteSize", index)));            //数据位
                port.Parity = byte.Parse(GetConfig(string.Format("Com_{0}_Parity", index)));              //奇偶校验
                port.StopBits = byte.Parse(GetConfig(string.Format("Com_{0}_StopBits", index)));            //停止位
                port.ReadTimeout = ;                                 //读超时时间

                if (!port.Opened)
                    port.Open();//打开串口 

                //初始化modem
                string[] strInit = GetConfig(string.Format("Com_{0}_Init", index)).Split('|');
                foreach (string str in strInit)
                {
                    if (str == string.Empty) continue;
                    string strData = str + "\r";
                    port.Write(System.Text.Encoding.ASCII.GetBytes(strData));
                    //Thread.Sleep(1000);
                    port.Read();
                }

                //拨号
                //string strDial = GetConfig(string.Format("Com_{0}_Dial", index)) + "\r";
                string strDial = "ATDT" + str11 + "\r";
                int dCount = int.Parse(GetConfig(string.Format("Com_{0}_dCount", index)));
                int wCount = int.Parse(GetConfig(string.Format("Com_{0}_wCount", index)));

                //挂机指令
                string strShutdown = GetConfig(string.Format("Com_{0}_Shutdown", index)) + "\r";

                bool isConntion = false;
                ; k < dCount; k++)
                {
                    //拨号
                    //port.Write(System.Text.Encoding.ASCII.GetBytes(strShutdown));  //拨号前挂机
                    port.Write(System.Text.Encoding.ASCII.GetBytes(strDial));

                    //等待20秒
                    ; j < wCount; j++)
                    {
                        ));

                        sbMsg.Insert(, "端口" + index + "拨号" + k + "/" + j + "\r\n");

                        //应答有NO DIALTONE字符表示拨号失败 ,busy表示忙音
                         || strRe.IndexOf()
                        {
                            isConntion = false;
                            sbMsg.Insert(, strRe + "\r\n");
                            break;
                        }

                        //没有出现忙音,默认为拨号成功
                        )
                        {
                            isConntion = true;
                            break;
                        }

                        Thread.Sleep();
                    }

                    //拨号成功
                    if (isConntion) break;
                }

                if (isConntion)
                {
                    MessageBox.Show("端口" + index + "拨号成功!");
                    sbMsg.Insert(, "端口" + index + "拨号成功!\r\n");
                }
                else
                {
                    MessageBox.Show("端口" + index + "拨号失败!");
                    sbMsg.Insert(, "端口" + index + "拨号失败!\r\n");
                }

                //挂机,10秒后挂机
                //Thread.Sleep(10000);
                port.Write(System.Text.Encoding.ASCII.GetBytes(strShutdown));

                port.Read();
                port.Close();

                if (MessageBox.Show("是否继续拨号?", "继续拨号", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    queue.Enqueue(index);
                }

            }
            catch (Exception ex)
            {
                sbMsg.Insert(, "打开端口" + index + "错误:" + ex.Message + "\r\n");
                return;
            }
        }

        /// <summary>
        /// 读取配置文件
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        /// 引用 port.BaudRate = int.Parse(GetConfig(string.Format("Com_{0}_BaudRate", index)));   port.ByteSize = byte.Parse(GetConfig(string.Format("Com_{0}_ByteSize", index)));
        private static string GetConfig(string key)
        {

            System.Configuration.AppSettingsReader config = new System.Configuration.AppSettingsReader();
            return config.GetValue(key, typeof(string)).ToString();
        }

    }

}

查看代码

app.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="ComCount" value="1"></add>

    <!--第一个拨号端口配置-->

    <!--端口名称-->
    <add key="Com_1_PortNum" value="COM3"/>
    <!--波特率,最大端口速度-->
    <add key="Com_1_BaudRate" value="115200"/>
    <add key="Com_1_ByteSize" value="8"/>
    <add key="Com_1_Parity" value="0"/>
    <add key="Com_1_StopBits" value="1"/>
    <!--初始化指令-->
    <add key="Com_1_Init" value="AT|AT&amp;FE0V1S0=0&amp;C1&amp;D2+MR=2;+DR=1;+ER=1;W2|ATS7=60S30=0L1M1+ES=3,0,2;+DS=3;+IFC=2,2;X4"/>
    <!--拨号指令 ATDT + 电话号码 比如10000号 则指令为: ATDT10000 -->
    <add key="Com_1_Dial" value="ATDT015215378122"/>
    <!--挂机指令-->
    <add key="Com_1_Shutdown" value="ATH0"/>
    <!--拨号次数-->
    <add key="Com_1_dCount" value="25"/>
    <!--等待时间-->
    <add key="Com_1_wCount" value="4"/>

  </appSettings>
</configuration>

查看代码

CommPort.cs类

using System;
using System.Runtime.InteropServices;

namespace DialUp
{
    class CommPort
    {
        /// <summary>端口名称</summary>
        public string PortNum;

        /// <summary> 波特率/每秒位数 </summary>
        public int BaudRate;

        /// <summary>数据位 (5,6,7,8)</summary>
        public byte ByteSize;

        /// <summary>奇偶校验位 0-4=no,odd,even,mark,space</summary>
        public byte Parity;

        /// <summary>停止位 0,1,2 = 1, 1.5, 2 </summary>
        public byte StopBits;

        /// <summary>超时时间</summary>
        public int ReadTimeout;

        /// <summary>指示串口是否打开</summary>
        public bool Opened = false;

        #region WinApi定义

        //comm port win32 file handle
        ;
        //win32 api constants
        private const uint GENERIC_READ = 0x80000000;
        private const uint GENERIC_WRITE = 0x40000000;
        ;
        ;

        [StructLayout(LayoutKind.Sequential)]
        public struct DCB
        {
            //taken from c struct in platform sdk
            public int DCBlength;           // sizeof(DCB)
            public int BaudRate;            // 指定当前波特率 current baud rate
            // these are the c struct bit fields, bit twiddle flag to set
            public int fBinary;          // 指定是否允许二进制模式,在windows95中必须主TRUE binary mode, no EOF check
            public int fParity;          // 指定是否允许奇偶校验 enable parity checking
            public int fOutxCtsFlow;      // 指定CTS是否用于检测发送控制,当为TRUE是CTS为OFF,发送将被挂起。 CTS output flow control
            public int fOutxDsrFlow;      // 指定CTS是否用于检测发送控制 DSR output flow control
            public int fDtrControl;       // DTR_CONTROL_DISABLE值将DTR置为OFF, DTR_CONTROL_ENABLE值将DTR置为ON, DTR_CONTROL_HANDSHAKE允许DTR"握手" DTR flow control type
            public int fDsrSensitivity;   // 当该值为TRUE时DSR为OFF时接收的字节被忽略 DSR sensitivity
            public int fTXContinueOnXoff; // 指定当接收缓冲区已满,并且驱动程序已经发送出XoffChar字符时发送是否停止。TRUE时,在接收缓冲区接收到缓冲区已满的字节XoffLim且驱动程序已经发送出XoffChar字符中止接收字节之后,发送继续进行。 FALSE时,在接收缓冲区接收到代表缓冲区已空的字节XonChar且驱动程序已经发送出恢复发送的XonChar之后,发送继续进行。XOFF continues Tx
            public int fOutX;               // TRUE时,接收到XoffChar之后便停止发送接收到XonChar之后将重新开始 XON/XOFF out flow control
            public int fInX;           // TRUE时,接收缓冲区接收到代表缓冲区满的XoffLim之后,XoffChar发送出去接收缓冲区接收到代表缓冲区空的XonLim之后,XonChar发送出去 XON/XOFF in flow control
            public int fErrorChar;     // 该值为TRUE且fParity为TRUE时,用ErrorChar 成员指定的字符代替奇偶校验错误的接收字符 enable error replacement
            public int fNull;          // eTRUE时,接收时去掉空(0值)字节 enable null stripping
            public int fRtsControl;     // RTS flow control  

            /*RTS_CONTROL_DISABLE时,RTS置为OFF
               RTS_CONTROL_ENABLE时, RTS置为ON
               RTS_CONTROL_HANDSHAKE时,
               当接收缓冲区小于半满时RTS为ON
               当接收缓冲区超过四分之三满时RTS为OFF
               RTS_CONTROL_TOGGLE时,
               当接收缓冲区仍有剩余字节时RTS为ON ,否则缺省为OFF*/

            public int fAbortOnError;   // TRUE时,有错误发生时中止读和写操作 abort on error
            public int fDummy2;        // 未使用 reserved
            public uint flags;
            public ushort wReserved;          // 未使用,必须为0 not currently used
            public ushort XonLim;             // 指定在XON字符发送这前接收缓冲区中可允许的最小字节数 transmit XON threshold
            public ushort XoffLim;            // 指定在XOFF字符发送这前接收缓冲区中可允许的最小字节数 transmit XOFF threshold
            public byte ByteSize;           // 指定端口当前使用的数据位   number of bits/byte, 4-8
            public byte Parity;             // 指定端口当前使用的奇偶校验方法,可能为:EVENPARITY,MARKPARITY,NOPARITY,ODDPARITY  0-4=no,odd,even,mark,space
            public byte StopBits;           // 指定端口当前使用的停止位数,可能为:ONESTOPBIT,ONE5STOPBITS,TWOSTOPBITS  0,1,2 = 1, 1.5, 2
            public char XonChar;            // 指定用于发送和接收字符XON的值 Tx and Rx XON character
            public char XoffChar;           // 指定用于发送和接收字符XOFF值 Tx and Rx XOFF character
            public char ErrorChar;          // 本字符用来代替接收到的奇偶校验发生错误时的值 error replacement character
            public char EofChar;            // 当没有使用二进制模式时,本字符可用来指示数据的结束 end of input character
            public char EvtChar;            // 当接收到此字符时,会产生一个事件 received event character
            public ushort wReserved1;         // 未使用 reserved; do not use
        }

        /// <summary>
        /// 超时结构
        /// </summary>
        [StructLayout(LayoutKind.Sequential)]
        private struct COMMTIMEOUTS
        {
            public int ReadIntervalTimeout;
            public int ReadTotalTimeoutMultiplier;
            public int ReadTotalTimeoutConstant;
            public int WriteTotalTimeoutMultiplier;
            public int WriteTotalTimeoutConstant;
        }

        [StructLayout(LayoutKind.Sequential)]
        private struct OVERLAPPED
        {
            public int Internal;
            public int InternalHigh;
            public int Offset;
            public int OffsetHigh;
            public int hEvent;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="lpFileName"></param>
        /// <param name="dwDesiredAccess"></param>
        /// <param name="dwShareMode"></param>
        /// <param name="lpSecurityAttributes"></param>
        /// <param name="dwCreationDisposition"></param>
        /// <param name="dwFlagsAndAttributes"></param>
        /// <param name="hTemplateFile"></param>
        /// <returns></returns>
        [DllImport("kernel32.dll")]
        private static extern int CreateFile(
          string lpFileName,                        // 要打开的串口名称
          uint dwDesiredAccess,                     // 指定串口的访问方式,一般设置为可读可写方式
          int dwShareMode,                          // 指定串口的共享模式,串口不能共享,所以设置为0
          int lpSecurityAttributes,                 // 设置串口的安全属性,WIN9X下不支持,应设为NULL
          int dwCreationDisposition,                // 对于串口通信,创建方式只能为OPEN_EXISTING
          int dwFlagsAndAttributes,                 // 指定串口属性与标志,设置为FILE_FLAG_OVERLAPPED(重叠I/O操作),指定串口以异步方式通信
          int hTemplateFile                         // 对于串口通信必须设置为NULL
        );

        /// <summary>
        /// 获取串口状态
        /// </summary>
        /// <param name="hFile"></param>
        /// <param name="lpDCB"></param>
        /// <returns></returns>
        [DllImport("kernel32.dll")]
        private static extern bool GetCommState(
          int hFile,                                //通信设备句柄
          ref DCB lpDCB                             // 设备控制块DCB
        );

        /// <summary>
        /// 构造串口控制块
        /// </summary>
        /// <param name="lpDef"></param>
        /// <param name="lpDCB"></param>
        /// <returns></returns>
        [DllImport("kernel32.dll")]
        private static extern bool BuildCommDCB(
          string lpDef,                             // 设备控制字符串
          ref DCB lpDCB                             // 设备控制块
        );

        /// <summary>
        /// 设置串口状态
        /// </summary>
        /// <param name="hFile"></param>
        /// <param name="lpDCB"></param>
        /// <returns></returns>
        [DllImport("kernel32.dll")]
        private static extern bool SetCommState(
          int hFile,                                // 通信设备句柄
          ref DCB lpDCB                             // 设备控制块
        );

        /// <summary>
        /// 获取串口超时时间
        /// </summary>
        /// <param name="hFile"></param>
        /// <param name="lpCommTimeouts"></param>
        /// <returns></returns>
        [DllImport("kernel32.dll")]
        private static extern bool GetCommTimeouts(
          int hFile,                                // 通信设备句柄 handle to comm device
          ref COMMTIMEOUTS lpCommTimeouts           // 超时时间 time-out values
        );

        /// <summary>
        /// 设置串口超时时间
        /// </summary>
        /// <param name="hFile"></param>
        /// <param name="lpCommTimeouts"></param>
        /// <returns></returns>
        [DllImport("kernel32.dll")]
        private static extern bool SetCommTimeouts(
          int hFile,                                // 通信设备句柄 handle to comm device
          ref COMMTIMEOUTS lpCommTimeouts           // 超时时间 time-out values
        );

        /// <summary>
        ///
        /// </summary>
        /// <param name="hFile"></param>
        /// <param name="lpBuffer"></param>
        /// <param name="nNumberOfBytesToRead"></param>
        /// <param name="lpNumberOfBytesRead"></param>
        /// <param name="lpOverlapped"></param>
        /// <returns></returns>
        [DllImport("kernel32.dll")]
        private static extern bool ReadFile(
          int hFile,                                // 通信设备句柄 handle to file
          byte[] lpBuffer,                          // 数据缓冲区 data buffer
          int nNumberOfBytesToRead,                 // 多少字节等待读取 number of bytes to read
          ref int lpNumberOfBytesRead,              // 读取多少字节 number of bytes read
          ref OVERLAPPED lpOverlapped               // 溢出缓冲区 overlapped buffer
        );

        /// <summary>
        ///
        /// </summary>
        /// <param name="hFile"></param>
        /// <param name="lpBuffer"></param>
        /// <param name="nNumberOfBytesToWrite"></param>
        /// <param name="lpNumberOfBytesWritten"></param>
        /// <param name="lpOverlapped"></param>
        /// <returns></returns>
        [DllImport("kernel32.dll")]
        private static extern bool WriteFile(
          int hFile,                                // 通信设备句柄 handle to file
          byte[] lpBuffer,                          // 数据缓冲区 data buffer
          int nNumberOfBytesToWrite,                // 多少字节等待写入 number of bytes to write
          ref int lpNumberOfBytesWritten,           // 已经写入多少字节 number of bytes written
          ref OVERLAPPED lpOverlapped               // 溢出缓冲区 overlapped buffer
        );

        /// <summary>
        /// 关闭接口
        /// </summary>
        /// <param name="hObject"></param>
        /// <returns></returns>
        [DllImport("kernel32.dll")]
        private static extern bool CloseHandle(
          int hObject   // handle to object
        );

        /// <summary>
        /// 获取最后一个错误信息
        /// </summary>
        /// <returns></returns>
        [DllImport("kernel32.dll")]
        private static extern uint GetLastError();
        #endregion

        /// <summary>
        /// 打开串口
        /// </summary>
        public void Open()
        {

            DCB dcbCommPort = new DCB();
            COMMTIMEOUTS ctoCommPort = new COMMTIMEOUTS();

            // 打开串口 OPEN THE COMM PORT.
            hComm = CreateFile(PortNum, GENERIC_READ | GENERIC_WRITE, , , OPEN_EXISTING, , );
            // 如果串口没有打开,就打开 IF THE PORT CANNOT BE OPENED, BAIL OUT.
            if (hComm == INVALID_HANDLE_VALUE)
            {
                throw (new ApplicationException("非法操作,不能打开串口!"));
            }

            // 设置通信超时时间 SET THE COMM TIMEOUTS.
            GetCommTimeouts(hComm, ref ctoCommPort);
            ctoCommPort.ReadTotalTimeoutConstant = ReadTimeout;
            ctoCommPort.ReadTotalTimeoutMultiplier = ;
            ctoCommPort.WriteTotalTimeoutMultiplier = ;
            ctoCommPort.WriteTotalTimeoutConstant = ;
            SetCommTimeouts(hComm, ref ctoCommPort);

            // 设置串口 SET BAUD RATE, PARITY, WORD SIZE, AND STOP BITS.
            GetCommState(hComm, ref dcbCommPort);
            dcbCommPort.BaudRate = BaudRate;
            dcbCommPort.flags = ;
            //dcb.fBinary=1;
            dcbCommPort.flags |= ;
            )
            {
                //dcb.fParity=1
                dcbCommPort.flags |= ;
            }
            dcbCommPort.Parity = Parity;
            dcbCommPort.ByteSize = ByteSize;
            dcbCommPort.StopBits = StopBits;
            if (!SetCommState(hComm, ref dcbCommPort))
            {
                //uint ErrorNu m= GetLastError();
                throw (new ApplicationException("非法操作,不能打开串口!"));
            }

            //判断端口是否打开
            //DCB dcbCommPort2 = new DCB();
            //GetCommState(hComm, ref dcbCommPort2); 

            Opened = true;
        }

        /// <summary>
        /// 关闭端口
        /// </summary>
        public void Close()
        {
            if (hComm != INVALID_HANDLE_VALUE)
            {
                CloseHandle(hComm);
            }
        }

        /// <summary>
        /// 读取指定字节数据
        /// </summary>
        /// <param name="NumBytes"></param>
        /// <returns></returns>
        public byte[] Read(int NumBytes)
        {
            byte[] BufBytes = new byte[NumBytes];
            byte[] OutBytes;

            if (hComm != INVALID_HANDLE_VALUE)
            {
                OVERLAPPED ovlCommPort = new OVERLAPPED();
                ;
                ReadFile(hComm, BufBytes, NumBytes, ref BytesRead, ref ovlCommPort);
                OutBytes = new byte[BytesRead];
                Array.Copy(BufBytes, OutBytes, BytesRead);
            }
            else
            {
                throw (new ApplicationException("串口未打开!"));
            }

            return OutBytes;
        }

        /// <summary>
        /// 写入字节到端口
        /// </summary>
        /// <param name="WriteBytes"></param>
        public void Write(byte[] WriteBytes)
        {
            if (hComm != INVALID_HANDLE_VALUE)
            {
                OVERLAPPED ovlCommPort = new OVERLAPPED();
                ;
                WriteFile(hComm, WriteBytes, WriteBytes.Length, ref BytesWritten, ref ovlCommPort);
            }
            else
            {
                throw (new ApplicationException("串口未打开!"));
            }
        }
    }

    #region 字符串和字节数组的转换
    /// <summary>
    /// 字符串和字节数组的转换
    /// </summary>
    class HexConverter
    {
        //   hex string to byte and byte to hex string
        /// <summary>
        /// 把字节型转换成十六进制字符串
        /// </summary>
        /// <param name="InBytes"></param>
        /// <returns></returns>
        public static string ByteToString(byte[] InBytes)
        {
            return System.Text.Encoding.ASCII.GetString(InBytes);

            //string StringOut = "";
            //foreach (byte InByte in InBytes)
            //{
            //    StringOut = StringOut + String.Format("{0:X2} ", InByte);
            //}
            //return StringOut;
        }

        /// <summary>
        /// 把十六进制字符串转换成字节数组
        /// </summary>
        /// <param name="InString"></param>
        /// <returns></returns>
        public static byte[] StringToByte(string InString)
        {
            return System.Text.Encoding.ASCII.GetBytes(InString);

            //string[] ByteStrings;
            //ByteStrings = InString.Split(" ".ToCharArray());
            //byte[] ByteOut;
            //ByteOut = new byte[ByteStrings.Length - 1];
            //for (int i = 0; i == ByteStrings.Length - 1; i++)
            //{
            //    ByteOut[i] = Convert.ToByte(("0x" + ByteStrings[i]));
            //}
            //return ByteOut;
        }
    }
    #endregion
}

查看代码

C# 使用猫拨打电话的更多相关文章

  1. Android无需申请权限拨打电话

    Android打电话有两种实现方法: 第一种方法,拨打电话跳转到拨号界面.源代码如下: Intent intent = new Intent(Intent.ACTION_DIAL); Uri data ...

  2. 【原】iOS学习之三种拨打电话方式的比较

    拨打电话小编从网上找到三种,在这里做一些总结和比较 1.基本使用 NSString *str = [[NSMutableString alloc] initWithFormat:@"tel: ...

  3. 拨打电话tel: 跳转到邮件mailto:(html)

    拨打电话 <a href="tel://0571866000">0571-866000</a> 跳转到邮件 <a href="mailto: ...

  4. ios调用本地拨打电话,发送短信

    电话.短信是手机的基础功能,iOS中提供了接口,让我们调用.这篇文章简单的介绍一下iOS的打电话.发短信在程序中怎么调用. 1.打电话   [[UIApplication sharedApplicat ...

  5. iOS拨打电话的三种方式

    iOS拨打电话的三种方式 1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示 1 2 var string = "tel:" + "1 ...

  6. a标签的妙用-拨打电话、发送短信、发送邮件

    前端时间在做手机WAP网站时,遇到需要点击页面上显示的电话号能直接拨号的需求,查找资料发现可以使用html的a标签完美实现该需求!记录下来以备后用...... 目前主流手机浏览器对H5的支持已经很不错 ...

  7. iOS 拨打电话三种方法

    小弟查了很多地方的关于iOS程序拨打电话,大都不全,今天我总结了三种方法,各有不同,拿来给大家分享,希望给大家有所帮助1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出 ...

  8. java攻城师之路(Android篇)--搭建开发环境、拨打电话、发送短信、布局例子

    一.搭建开发环境 1.所需资源 JDK6以上 Eclipse3.6以上 SDK17, 2.3.3 ADT17 2.安装注意事项 不要使用中文路径 如果模拟器默认路径包含中文, 可以设置android_ ...

  9. iOS_拨打电话/发送短信

    GitHub address : https://github.com/mancongiOS/makeACallAndSendMessage.git 功能一: 拨打电话 1.可以有提示框.提示该电话号 ...

随机推荐

  1. JavaScript之BOM+DOM

    BOM 浏览器对象模型, 用于把浏览器相关的组件封装为对象进行操作. BOM是包含了DOM的. window对象 弹出框相关 确认: 取消: 与打开关闭window有关的方法 定时器相关 暂停选老婆 ...

  2. 使用idea搭建Spring boot+jsp的简单web项目

    大家好: 这是我的第一篇博客文章,简单介绍一下Spring boot + jsp 的搭建流程,希望给跟我一样新接触Spring boot的读者一点儿启发. 开发工具:jdk1.8   idea2017 ...

  3. SDUT 1266 出栈序列统计(卡特兰数)

    这道题是回溯算法,网上一查是卡特兰数先占上代码,题解过两天会写. #include <bits/stdc++.h> using namespace std; int main() { // ...

  4. mysql8 主从配置方案

    先理论,后实践!在理论的基础上有指导性的实践会更快,也更容易发现错误.理论参考高性能mysql这本书,之前大概看过一遍,但实际生产中并没有怎么注意mysql性能这方面,今天用到主备,就把第十章的复制拿 ...

  5. Android逆向之旅---Android应用的汉化功能(修改SO中的字符串内容)

    一.前言 今天我们继续来讲述逆向的知识,今天我们来讲什么呢?我们在前一篇文章中介绍了关于SO文件的格式,今天我们继续这个话题来看看如何修改SO文件中的内容,看一下我们研究的主题: 需求:想汉化一个Ap ...

  6. delphi 加入超链接

    delphi 加入超链接//在uses中加入ShellAPI//通过该lpFile参数可以实现链接到主页或ftp站点 ShellExecute(handle,nil,pchar('http://www ...

  7. 洛谷 P3806 (点分治)

    题目:https://www.luogu.org/problem/P3806 题意:一棵树,下面有q个询问,问是否有距离为k的点对 思路:牵扯到树上路径的题都是一般都是点分治,我们可以算出所有的路径长 ...

  8. [HDU2276]Kiki & Little Kiki 2

    题目:Kiki & Little Kiki 2 链接:http://acm.hdu.edu.cn/showproblem.php?pid=2276 分析: 1)如果前一盏灯亮着,则改变这一盏灯 ...

  9. junit中配置log4j日志

    在对项目单元测试的时候,有时候会使用log4j来打印日志,这个时候需要对log4j进行配置. 声明和继承SpringJUnit4ClassRunner类,在这个类中对log4j的配置文件进行加载. p ...

  10. JVM调优(二)——基于JVisualVM的可视化监控

    JVM调优(二)--基于JVisualVM的可视化监控 工具路径://java/jdk1.8xxx/bin/JVisuaVM.exe 监控本地的Tomcat 监控远程Tomcat 监控普通的JAVA进 ...