Click here to Skip to main content
15,860,943 members
Home / Discussions / C#
   

C#

 
QuestionWhat "is" c#`s Double.NaN? Pin
GerVenson16-Sep-20 10:53
professionalGerVenson16-Sep-20 10:53 
AnswerRe: What "is" c#`s Double.NaN? Pin
Gerry Schmitz16-Sep-20 19:59
mveGerry Schmitz16-Sep-20 19:59 
Questionargument 1 cannot convert from IBase<T> to T where T:IBase<T> Pin
koirat15-Sep-20 14:34
koirat15-Sep-20 14:34 
AnswerRe: argument 1 cannot convert from IBase<T> to T where T:IBase<T> Pin
OriginalGriff15-Sep-20 20:04
mveOriginalGriff15-Sep-20 20:04 
AnswerRe: argument 1 cannot convert from IBase<T> to T where T:IBase<T> Pin
Richard Deeming15-Sep-20 21:59
mveRichard Deeming15-Sep-20 21:59 
QuestionProcess Start, building Url with & Pin
jkirkerx15-Sep-20 14:00
professionaljkirkerx15-Sep-20 14:00 
AnswerRe: Process Start, building Url with & Pin
Dave Kreskowiak15-Sep-20 15:05
mveDave Kreskowiak15-Sep-20 15:05 
AnswerRe: Process Start, building Url with & Pin
Richard Deeming15-Sep-20 21:48
mveRichard Deeming15-Sep-20 21:48 
cmd /c and cmd /k always treat & as the separator between multiple commands. You are telling it to start the URL up to "srn=216", and then run the command orderid=42, which won't be recognized.

It won't understand HTML encoding, so using &amp; will simply tell it to start the URL up to "srn=216", and then run the command amp, which also won't be recognized.

If you use the URL-encoded value %26, the full URL will be executed. But it won't be the URL you need: instead of passing two query-string parameters, srn=216 and orderid=42, you'll be passing a single parameter - src=216%26orderid=42. On the server, the src parameter will be equal to "216&orderid=42".

To escape the URL properly, you would need to prefix the & with ^, and surround the URL with quotes:
C#
string url = "...?srn=216^&" + _ebayOrder.OrderNumber;

var psi = new ProcessStartInfo()
{
    FileName = "cmd",
    WindowStyle = ProcessWindowStyle.Hidden,
    UseShellExecute = false,
    CreateNoWindow = true,
    Arguments= "/c start \"" + url + "\"",
};

Process.Start(psi);
But, as Dave said, you don't need to do that. Just execute the URL directly:
C#
string url = "....?srn=216&" + _ebayOrder.OrderNumber;
Process.Start(url);
This will use the ShellExecute function, which will launch the user's default browser and navigate to the URL.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Process Start, building Url with & Pin
jkirkerx16-Sep-20 5:39
professionaljkirkerx16-Sep-20 5:39 
QuestionASP.NET runtime error Pin
Member 1492460715-Sep-20 9:54
Member 1492460715-Sep-20 9:54 
AnswerRe: ASP.NET runtime error Pin
Afzaal Ahmad Zeeshan15-Sep-20 11:28
professionalAfzaal Ahmad Zeeshan15-Sep-20 11:28 
GeneralRe: ASP.NET runtime error Pin
Member 1492460715-Sep-20 12:13
Member 1492460715-Sep-20 12:13 
QuestionSystem.NullReferenceException: 'Object reference not set to an instance of an object.' Pin
KaushalDave14-Sep-20 19:56
KaushalDave14-Sep-20 19:56 
AnswerRe: System.NullReferenceException: 'Object reference not set to an instance of an object.' Pin
OriginalGriff14-Sep-20 20:16
mveOriginalGriff14-Sep-20 20:16 
AnswerRe: System.NullReferenceException: 'Object reference not set to an instance of an object.' Pin
Richard Deeming14-Sep-20 21:38
mveRichard Deeming14-Sep-20 21:38 
GeneralRe: System.NullReferenceException: 'Object reference not set to an instance of an object.' Pin
KaushalDave14-Sep-20 22:49
KaushalDave14-Sep-20 22:49 
Questionhow to connect instagram api Pin
many esmaeili13-Sep-20 22:47
many esmaeili13-Sep-20 22:47 
AnswerRe: how to connect instagram api Pin
OriginalGriff13-Sep-20 22:54
mveOriginalGriff13-Sep-20 22:54 
GeneralRe: how to connect instagram api Pin
many esmaeili15-Sep-20 1:40
many esmaeili15-Sep-20 1:40 
GeneralRe: how to connect instagram api Pin
OriginalGriff15-Sep-20 2:18
mveOriginalGriff15-Sep-20 2:18 
GeneralRe: how to connect instagram api Pin
Richard MacCutchan15-Sep-20 3:12
mveRichard MacCutchan15-Sep-20 3:12 
GeneralRe: how to connect instagram api Pin
OriginalGriff15-Sep-20 3:44
mveOriginalGriff15-Sep-20 3:44 
GeneralRe: how to connect instagram api Pin
Gerry Schmitz15-Sep-20 4:20
mveGerry Schmitz15-Sep-20 4:20 
AnswerRe: how to connect instagram api Pin
Richard MacCutchan13-Sep-20 23:09
mveRichard MacCutchan13-Sep-20 23:09 
Questionc# stupid severe issue loop ! Pin
Isawyouoo13-Sep-20 3:25
Isawyouoo13-Sep-20 3:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.