Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/303.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用YMSGPro组件连接雅虎_C# - Fatal编程技术网

C# 使用YMSGPro组件连接雅虎

C# 使用YMSGPro组件连接雅虎,c#,C#,有人在c#中使用过YMSGPro.OCX吗? 我如何用它连接到雅虎 如果未使用,为什么会出现此错误-未分配局部变量“js”的用户- YMSGClass ys; string username="m.moh3en1375"; string password="mypw"; string host = "a"; string port = "2800"; string amoo = ""; string hole = ""; ys.Connect(ref username,ref password,

有人在c#中使用过YMSGPro.OCX吗? 我如何用它连接到雅虎

如果未使用,为什么会出现此错误-未分配局部变量“js”的用户-

YMSGClass ys;
string username="m.moh3en1375";
string password="mypw";
string host = "a";
string port = "2800";
string amoo = "";
string hole = "";
ys.Connect(ref username,ref password,ref host,ref port,ref amoo,ref hole);
这也是错误的:

YMSGClass ys = new YMSGClass();
你需要的是这个。

我发现了一些关于OCX的VB6代码。。将其转换为C#将非常容易。 下面是一些使用OCX的Yahoo聊天室客户端

Private Sub Command1_Click () 
Call YMSG1.Connect (User.Text, Pass.Text) 
End Sub 

Private Sub Command2_Click () 
Call YMSG1.PckChangeStatus (TXTST.Text, False) 
End Sub 

Private Sub Command3_Click () 
Call YMSG1.PckSendTextRoom (pmtoroom.Text) 
End Sub 

Private Sub Command4_Click () 
List1.Clear 

Call YMSG1.PckJoindRoom (Toroom.Text) 


End Sub 

Private Sub Command5_Click () 
Call YMSG1.PckLeftRoom 
End Sub 


Private Sub Form_Load () 
Call YMSG1.Invisible (True) 

End Sub 

Private Sub lblst_Change () 
If lblst.Caption = "login." Then 
YMSG1.ConvertFarsi = True 
YMSG1.FilterMessage = True 
End If 
End Sub 

Private Sub mnuAbut_Click () 
abut.Show 
End Sub 

Private Sub Timer1_Timer () 
On Error GoTo Eror 
Call YMSG1.PckSendTextRoom (PM2Room.Text) 
Eror: 
End Sub 

Private Sub YMSG1_IncomingAddRequest (ByVal From As String, ByVal ToUser As String, ByVal Message As String, ByVal SenderName As Variant, ByVal SenderLastName As String, ByVal AutoAdd As Boolean) 
YMSG1.PckAcceptAdd From, ToUser 
Call YMSG1.PckSendMsg (From, txtadd.Text) 
End Sub 

Private Sub YMSG1_IncomingAppear (ByVal User As String, ByVal Status As YMSGMode_V2.StatusYID, Messege As String) 
If Status = Available Then Call YMSG1.PckSendMsg (User, txtOnline.Text) 
End Sub 

Private Sub YMSG1_IncomingCaptcha (ByVal PictureLink As String, ByVal DATA As String) 
Form2.Web.Navigate "http://captcha.chat.yahoo.com/go/captchat/?img =" & PictureLink & "&. Intl = us &. Lang = en-US" 
Form2.Show 
Timer1.Interval = "30000" 
End Sub 

Private Sub YMSG1_IncomingChatList (ByVal ChatterLst As String, ByVal Status As YMSGMode_V2.StatusRoom, ByVal DATA As String) 
If Status = Joind Then 
List1.AddItem ChatterLst 
List2.AddItem ChatterLst & "Join Room" 
Call YMSG1.PckSendMsg (ChatterLst, txtWel.Text) 


lblUser.Caption = "Users:" & List1.ListCount 
ElseIf Status = Leave Then 
List2.AddItem ChatterLst & "Left Room" 
Call YMSG1.PckSendMsg (ChatterLst, txtWel.Text) 

For i = 0 To List1.ListCount - 1 
If List1.List (i) = ChatterLst Then 
List1.RemoveItem i 
End If 
Next i 
lblUser.Caption = "Users:" & List1.ListCount 
ElseIf Status = RoomFull Then 
MsgBox ("Room The Full") 
End If 


End Sub 

Private Sub YMSG1_IncomingMessage (ByVal From As String, ByVal ToUser As String, ByVal TextMessage As String) 
Call YMSG1.PckSendMsg (From, txtrespones.Text) 
End Sub 

Private Sub YMSG1_IncomingRoomTxtMessage (ByVal FromUser As String, ByVal Msg As String, ByVal Client As String, ByVal RoomName As String, ByVal DATA As String) 
List2.AddItem FromUser & ":" & Msg 
End Sub 

Private Sub YMSG1_Status (ByVal MsgStatus As String, ByVal Status As String, ByVal Connecting As Boolean) 
lblst.Caption = MsgStatus 
End Sub
这是一些照片
谢谢您的回答,但我不知道VB6

这是我的密码:

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 YMSGPro;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            YMSGClass ym = null;
            string username = "m.mohsen1375";
            string password = "pw";
            ym.Connect(ref username, ref password);
        }
    }
}
问题是编译器需要connect方法的所有6个参数,并且在代码中只插入用户名和密码(2个参数)

下面是编译器的错误:

方法“Connect”没有重载接受“2”个参数


谢谢大家!

如果您需要帮助,您需要有一些方法来记录此API…这是组件下载可执行组件的链接与提供有问题的API不同…提供该组件文档的链接会很好-要求人们下载完整组件是不合理的。Ook,但您能告诉我如何下载吗我能解决这个问题吗(我问):D对不起,我的英语很糟糕,我不知道我在说什么:((