我在网上搜索了很多关于这个问题,但我没有收到任何解决方案。
这是我的方法
在ASP.NET的按钮单击事件中。请帮助我,我在本地主机上运行这个。我不知道我哪里出错了。我甚至没有得到任何错误,方法正在执行,但图像没有发送到接收器。
private void Send()
{
string from = "+91*********";
string password = "****";
string nickName ="****";
string to = "+91" + PhoneNumberTextBox.Text;
string message = MessageTextBox.Text;
byte[] img = File.ReadAllBytes("C:\\Users\\myPc\\Downloads\\a.jpg");
WhatsAppApi.WhatsApp wa = new WhatsAppApi.WhatsApp(from, password, nickName, false, false);
wa.OnConnectSuccess += () =>
{
wa.SendMessage(to, message);
wa.SendMessageImage(to + "@s.whatsapp.net", img, ApiBase.ImageType.JPEG);
};
wa.OnLoginFailed += (data) =>
{
};
wa.Login();
};
wa.OnConnectFailed += (ex) =>
{
};
wa.Connect();
}
2条答案
按热度按时间5sxhfpxr1#
你没有登录。试试下面的代码,希望对你有帮助。
zwghvu4y2#
Google更改了Chrome和Chrome Web驱动程序拓扑结构,我们可能会使用另一种浏览器和Web驱动程序。
从NuGet安装Selenium.WebDriver.ChromeDriver,然后您可以执行以下操作:
IWebDriver driver = new ChromeDriver(Environment.CurrentDirectory)