p2pserver.listen(Convert.ToInt32(txtport.Text));        //错误:输入的字符串格式不正确。
就是想把端口号转换成整型的。。结果老提示那种错误。。请高手指点

解决方案 »

  1.   

    好像ip不是这种转换的
    IPAddress.Parse 方法
    你查一下,
      

  2.   

    直接转换成int,用Int.Parse() -----你输入了字符串么?
      

  3.   

    When the system sends this message as a result of a SystemParametersInfo call, the wParam parameter is the value of the uiAction parameter passed to the SystemParametersInfo function. For a list of values, see SystemParametersInfo.When the system sends this message as a result of a change in policy settings, this parameter indicates the type of policy that was applied. This value is 1 if computer policy was applied or zero if user policy was applied.When the system sends this message as a result of a change in locale settings, this parameter is zero.When an application sends this message, this parameter must be NULL.
      

  4.   

    When the system sends this message as a result of a SystemParametersInfo call, the wParam parameter is the value of the uiAction parameter passed to the SystemParametersInfo function. For a list of values, see SystemParametersInfo.When the system sends this message as a result of a change in policy settings, this parameter indicates the type of policy that was applied. This value is 1 if computer policy was applied or zero if user policy was applied.When the system sends this message as a result of a change in locale settings, this parameter is zero.When an application sends this message, this parameter must be NULL.