2011-07-19 11 views
0

私はそのWebリンクにパラメータを渡すことによって、私によって作成されたWebページを開きたい、 私はこのようにそれを開こう:オープンWindowsフォームでのWebリンク(Vb.Net)

Dim aaa As String = String.Format _ 
("C:\Documents and Settings\user\Desktop\web site 1\HRMSExport1.aspx", _ 
"?_mchno={0}&_batch={1}&_Points={2}&_ovrpt={3}&_gstrID={4}& _ 
_gstrPassword={5}&_gstrDataSource={6}&_gstrCatalog={7}", _ 
cmbMachine.Text, txtBatch.Text, inpstd, _ 
Overpoints, gstrID, gstrPassword, gstrDataSource, gstrCatalog) 
Process.Start(aaa) 

が失敗します。 パラメータを使用してウェブリンクを開く方法あなたはString.Formatのに

を渡されている2つのフォーマット文字列を持っているように見えます

+0

してください、あなたはその物理アドレスで*の.aspxファイルを開く場合は、IISと.NET Frameworkはそれについて何も知らないので、それは、働いていないだろう、ということに注意してください。 'http:// localhost/web site 1/HRMSExport1.aspx'を使うべきです。 – VMAtm

答えて

0

はこれを試してみてください:

Dim aaa As String = String.Format _ 
    ("C:\Documents and Settings\user\Desktop\web site 1\HRMSExport1.aspx?_mchno={0}&_batch={1}&_Points={2}&_ovrpt={3}&_gstrID={4}&_gstrPassword={5}&_gstrDataSource={6}&_gstrCatalog={7}", _ 
    cmbMachine.Text, txtBatch.Text, inpstd, Overpoints, gstrID, gstrPassword, gstrDataSource, gstrCatalog) 
    Process.Start(aaa) 
1

あなたのString.Formatのコマンドと改行が正しくありません。 2行目で、アンパサンドでカンマを置き換えます。 3行目では、String内で行継続を使用することはできません。文字列を閉じ、行の続きを使用して、残りの文字列を追加します。

試してみてください。

Dim commandline As String = String.Format _ 
    ("C:\Documents and Settings\user\Desktop\web site 1\HRMSExport1.aspx" & _ 
    "?_mchno={0}&_batch={1}&_Points={2}&_ovrpt={3}&_gstrID={4}&" & _ 
    "_gstrPassword={5}&_gstrDataSource={6}&_gstrCatalog={7}", _ 
    _cmbMachine.Text, txtBatch.Text, inpstd, Overpoints, gstrID, _ 
    gstrPassword, gstrDataSource, gstrCatalog) 
Process.Start(commandline) 
関連する問題