我正在制作我的第一个Skype应用程序,它可以简单地向用户发送消息,但是当我调试时,我得到一个异常会导致我的应用程序崩溃 这是代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using skype_app;
using SKYPE4COMLib;
namespace skype_app
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
var oskype = new SKYPE4COMLib.Skype();
oskype.PlaceCall(textBox1.Text);
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
var oskype = new SKYPE4COMLib.Skype();
oskype.SendMessage(textBox1.Text, …Run Code Online (Sandbox Code Playgroud) 如何使用foreach语句在用户给出的2个值之间循环?
我正在创建一个扫描端口的应用程序,所以我希望用户指定要搜索的端口; 这里有一些不起作用的示例代码,但应该可以帮助您理解我在寻找的内容:
int port1 = Int32.Parse(TextBox1.Text);
int port2 = Int32.Parse(TextBox2.Text);
foreach(int between port1 and port2)
{
//do something
}
Run Code Online (Sandbox Code Playgroud)
有关如何做到这一点的任何建议?