المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Using a c# DLL in VS2005



C# Programming
06-18-2009, 05:56 AM
Hi im trying to use a c# dll i found here (http://www.c-sharpcorner.com/UploadFile/tylerkline/TelnetScripting11282005001158AM/TelnetScripting.aspx) for telnet scripting . Ive added it to the reference's and its showing up in the object browser correctly but when i try the following code

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

namespace test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
ScriptingTelnet.Connect();
}
}
}

I get the exception

Error 1 An object reference is required for the nonstatic field, method, or property 'objActiveSolutions.ScriptingTelnet.Connect()' C:\Users\Shuttle\Desktop\test1\test1\Form1.cs 21 13 test1

Im pretty new to c# but ive all ready added the reference with using Telnet; can anyone tell me how to use this c# dll ?