简体   繁体   中英

Skype4COM C# Help!! if skype.CurrentUserProfile.FullName = “David”

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'
        }
    }
}

= is an assignment operator. You should use comparison operators in if statements, in this case == . Also the statement should be in parenthesis, like

if (a == b)
{
    \\ do your thing
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM