2017-03-05 69 views
0

我一直在遇到一個問題,當我點擊應該重定向到貝寶的按鈕時,它會打開我的文檔。它在之前運行,但是當我將代碼傳輸到另一臺PC時發生錯誤。幫幫我!貝寶沙箱網址打開我的文檔

這裏是aspx.cs代碼

保護無效btnPayOnline_Click(對象發件人,EventArgs的) {

 string url = ""; 

     string business = "[email protected]"; 
     string description = "Buy"; 
     string country = "PH"; 
     string currency = "PHP"; 
     string amount = Label1.Text; 

     url += "https://www.sandbox.paypal.com/cgi-bin/webscr" + 
      "?cmd=" + "_xclick" + 
      "&business=" + business + 
      "&amount=" + amount + 
      "&lc=" + country + 
      "&item_name=" + description + 
      "&currency_code=" + currency + 
      "&bn=" + "PP%2dBuyNowBF"; 

     System.Diagnostics.Process.Start("explorer.exe", url); 

}

這裏是ASPX代碼:

我真的沒有看到p roblem是

+0

aspx代碼對不起 –

回答

0

您的程序啓動文件夾資源管理器(因此顯示您的默認本地目錄),而不是您的Web瀏覽器。

替換explorer.exeiexplore.exe應該可以解決您的問題。

+0

工作!非常感謝! –

+0

'Process.Start(「http://google.com」)是一個更好的選擇,因爲它將打開默認瀏覽器而不是Internet Explorer。 – Gooz