2013-08-09 8 views
1

아무도 C#에서 YMSGPro.OCX를 사용합니까? 그걸로 어떻게 야후에 연결할 수 있습니까?YMSGPro 구성 요소를 사용하여 yahoo에 연결

사용하지 않으면 왜이 오류가 발생합니까? 할당되지 않은 지역 변수 '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(); 
+0

도움이 필요하시면이 API를 문서화 할 수있는 방법이 필요합니다 ... –

+0

여기에 컴포넌트가 있습니다. [링크] (http://www.4shared.com/file/6e9vOcRX/YMSGPro.html?) –

+0

A 실행 가능한 구성 요소를 다운로드하는 링크는 문제의 API를 제공하는 것과 다릅니다 ... –

답변

0

이있다. https://github.com/klog/ycs

이 OCX에 관한 일부 VB6 코드를 발견했습니다. C#으로 변환하는 것이 매우 쉽습니다. 여기이 OCX 여기

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 

를 사용하여 야후 채팅방 클라이언트의 어떤 것은 일부 사진 enter image description here enter image description here enter image description here 답변에 대한 enter image description here enter image description here

0

감사하지만 나는 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); 
     } 
    } 
} 

문제는 그 컴파일러는 그냥 사용자 이름과 암호 (2 인자)를 안치 연결 방법과 코드의 모든 (6 개) 인수를 필요가 있습니다 :

여기 내 코드입니다.

방법에 대한 과부하 '연결'이 '2'인수를하지 : 여기

보기는 컴파일러의 오류입니다.

감사합니다.

관련 문제