-1

I am trying to make a program so if my Skype name/id is David it wont do anything but if its someone else Skype name/id it will change the RichMoodText I know how to change the RichMoodText but its just detecting if its a certain profile

Please Help

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 SKYPE4COMLib;

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

        private void Form1_Load(object sender, EventArgs e)
        {
            //RMT Means RichMoodText
            string RMT = "Hi";
            //CFN Means Creators FullName
            string CFN = "David Fedrick";

            Skype skype = new Skype();
            skype.Attach();
            //skype.CurrentUserProfile.RichMoodText = RMT;

            if skype.CurrentUserProfile.FullName = CFN; <---- 
            Cannot implicitly convert type 'string' to 'bool'
        }
    }
}
4

1 回答 1

3

=是赋值运算符。在这种情况下,您应该在 if 语句中使用比较运算符==。该语句也应放在括号中,例如

if (a == b)
{
    \\ do your thing
}
于 2015-05-19T17:34:28.723 回答