sql端点应用
时间:2011-01-03 来源:qanholas
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Configuration;
using System.Net;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
cctv.myTestPoint p = new WindowsApplication1.cctv.myTestPoint();
p.UseDefaultCredentials = false;
System.Net.CredentialCache myCreds = new System.Net.CredentialCache();
myCreds.Add(new Uri(p.Url), "NTLM", System.Net.CredentialCache.DefaultCredentials.GetCredential(new Uri(p.Url), "NTLM"));
p.Credentials = myCreds;
DataSet ds = (DataSet)((p.GetMyData())[0]);
dataGridView1.DataSource = ds.Tables[0].DefaultView;
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Configuration;
using System.Net;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
cctv.myTestPoint p = new WindowsApplication1.cctv.myTestPoint();
p.UseDefaultCredentials = false;
System.Net.CredentialCache myCreds = new System.Net.CredentialCache();
myCreds.Add(new Uri(p.Url), "NTLM", System.Net.CredentialCache.DefaultCredentials.GetCredential(new Uri(p.Url), "NTLM"));
p.Credentials = myCreds;
DataSet ds = (DataSet)((p.GetMyData())[0]);
dataGridView1.DataSource = ds.Tables[0].DefaultView;
}
}
}
相关阅读 更多 +