是否可以在windows窗体桌面应用程序中放置一个paypal的捐赠按钮。
我有一个网站,我将在其中托管我的桌面应用程序,但我想在应用程序的“关于”框中创建一个捐赠按钮,出于安全考虑,我不想使用 api 在我的 winform 应用程序上进行任何交易.
我在某处读到我可以创建链接标签并将其放置在应用程序中。
我的问题是,制作按钮的正确方法应该是什么,该按钮会将用户导航到 Paypal 网站以进行交易。我有一个经过验证的首映帐户。
[已编辑 - 捐赠按钮?] 我在选项中得到的屏幕截图,没有捐赠按钮..
最佳答案
我通过简单的谷歌搜索找到了这个网站。这解释了如何在 C# 应用程序中执行此操作。 http://www.gorancic.com/blog/net/c-paypal-donate-button
这是那里的确切代码:
private void btnDonate_Click(object sender, System.EventArgs e)
{
string url = "";
string business = "my@paypalemail.com"; // your paypal email
string description = "Donation"; // '%20' represents a space. remember HTML!
string country = "AU"; // AU, US, etc.
string currency = "AUD"; // AUD, USD, etc.
url += "https://www.paypal.com/cgi-bin/webscr" +
"?cmd=" + "_donations" +
"&business=" + business +
"&lc=" + country +
"&item_name=" + description +
"¤cy_code=" + currency +
"&bn=" + "PP%2dDonationsBF";
System.Diagnostics.Process.Start(url);
}
一定要输入正确的 URL,因为如果你不这样做,它将无法工作(当然):D
点击按钮后你会得到这个页面:
关于c# - 在桌面应用程序中制作捐赠按钮的正确方法,它将用户导航到 Paypal 网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21904906/