vb.net - 如何从 SQL 数据库中获取 API 链接中的电子邮件地址?
问题描述
Try
Dim webClient As New System.Net.WebClient
Dim result As String = webClient.DownloadString("http://emailsendingnotification.herokuapp.com/sendEmail/toemail@gmail.com/TheTransactionisSuccessfull")
Catch ex As Exception
End Try
在上面的代码而不是 API 链接中的 toemail@gmail.com 中,我需要从 SQL Server 2014 Management Studio 中创建的数据库中获取电子邮件 ID?
Try
Dim webClient As New System.Net.WebClient
Dim result As String = webClient.DownloadString("http://emailsendingnotification.herokuapp.com/sendEmail/+TextEmailAddress.Text.ToString()+/TheTransactionisSuccessfull")
Catch ex As Exception
End Try
这是我尝试过的,但没有任何结果。
预期的结果是应该在电子邮件地址上发送一封说明交易成功的通知邮件。
解决方案
Dim result As String = webClient.DownloadString("http://emailsendingnotification.herokuapp.com/sendEmail/" & TextEmailAddress.Text.ToString() & "/TheTransactionisSuccessfull")
我看到您在该文本框中发送字符串“TextEmailAddress.Text.ToString()”而不是电子邮件作为字符串“something@hello.com”
做 msgbox(result) 你会看到问题
推荐阅读
- windows - 我可以在运行 Windows/WSL2 的远程主机上的容器中使用 VS Code 进行开发吗?
- excel - 在 Excel 中按行生成随机(“是”、“否”)并使 10% 的随机行具有值“是”,其余为“否”值
- python - 创建唯一实例有效,但再次调用类时如何获取引用?
- python - Python:如何在函数中获取未指定的参数名称(*args)
- php - 如何使用 Codeigniter 从数据库中解密加密密码
- javascript - 如何通过 localStorage.getItem() 恢复值
- node.js - 使用 SQL Server 和 Hapi.Dev 登录的 Auth.js 文件出现问题
- python - 带有重复项的子集,仅返回空列表的问题
- selenium - 动态 WebElement 使 ElementNotInteractable 异常
- javascript - 想要反转 JavaScript “回到顶部”按钮以制作匹配的“跳到底部”按钮