0

我创建了一个网站,我想向我的用户发送短信。短信已正确发送到 0zeki 服务器消息,但问题是它正在重定向到服务器 URL,而我只希望发送短信并且没有响应重定向到服务器可以有人帮忙吗

    Dim con As New SqlConnection(_start)
    con.Open()
    Dim sql1 As String = "SELECT TOP (1) Member.PhoneNumber FROM  (SELECT  TOP (2) BidID, Date, BiddingPrice, Status, AuctionID, BuyerID, WinningPrice from BID ORDER BY BidID DESC) AS tabel1 INNER JOIN Buyer ON tabel1.BuyerID = Buyer.BuyerID INNER JOIN Member ON Buyer.MemberID = Member.MemberID INNER JOIN Auction ON tabel1.AuctionID = Auction.AuctionID WHERE(Auction.AuctionID = @auction) ORDER BY tabel1.BidID"
    Dim auction1 As Integer = Convert.ToInt32(lblauction.Text)
    Dim sqlcommand As New SqlCommand(sql1, con)
    sqlcommand.Parameters.AddWithValue("@auction", auction1)
    Dim phone As String = sqlcommand.ExecuteScalar

    Dim sql2 As String = "SELECT Item.Name FROM Item INNER JOIN Auction ON Item.ItemID = Auction.ItemID WHERE (Auction.AuctionID = @auction)"
    Dim cmd As New SqlCommand(sql2, con)
    cmd.Parameters.AddWithValue("@auction", auction1)
    Dim name As String = cmd.ExecuteScalar

    Dim message As String = "Your bid has been overbid please, Visit the Website to bid against on auction " + name + "thanks you"

    Response.Redirect("http://localhost:9333/Ozeki?login=admin&password=abc123&action=sendMessage&messagetype=SMS&recepient=" + phone + "&messageData=" + message)
4

1 回答 1

1

只需将 Response.Redirect 替换为

WebRequest.Create("http://localhost:9333/Ozeki?login=admin&password=abc123&action=sendMessage&messagetype=SMS&recepient=" + phone + "&messageData=" + message)
.GetResponse();

它将调用服务并且不会重定向页面。

于 2014-03-21T13:22:06.353 回答