我是C#的新手,這是我的第一個程序。我試圖集成一個來自OVH.IE的SOAPI(更多信息在這裏:www.ovh.ie/products/soapi.xml),但是無論何時啓動程序並單擊登錄按鈕,程序崩潰(VS2012的內存使用量增加,然後崩潰)。程序崩潰調試
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Web.Services;
namespace Server_Manager
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
}
void login(string uid, string pwd, string dc)
{
if (dc == "OVH")
{
managerService soapi = new managerService();
string session = soapi.login(uid, pwd, "ie", false);
if (String.IsNullOrWhiteSpace(session))
{
MessageBox.Show("Not Logged");
}
else
{
MessageBox.Show("Logged In");
}
}
}
private void button1_Click(object sender, EventArgs e)
{
if (String.IsNullOrWhiteSpace(textBox1.Text) || String.IsNullOrWhiteSpace(textBox1.Text))
{
MessageBox.Show("Please Fill all the Details");
}
else
{
string uid, pwd, dc;
uid = textBox1.Text;
pwd = textBox2.Text;
dc = comboBox1.Text;
login(uid,pwd,dc);
}
MessageBox.Show(comboBox1.Text);
}
}
}
崩潰時是否收到任何異常消息? – ayls
api是否支持.net框架版本? – urlreader
我認爲你是在登錄功能內部調用登錄。 – sajanyamaha