Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reading from excel.. Pin
fly90424-Apr-09 14:48
fly90424-Apr-09 14:48 
GeneralRe: Reading from excel.. Pin
Jacob Dixon24-Apr-09 14:50
Jacob Dixon24-Apr-09 14:50 
AnswerRe: Reading from excel.. Pin
Ashfield23-Apr-09 20:56
Ashfield23-Apr-09 20:56 
GeneralRe: Reading from excel.. Pin
Jacob Dixon24-Apr-09 13:38
Jacob Dixon24-Apr-09 13:38 
GeneralRe: Reading from excel.. Pin
Ashfield25-Apr-09 7:34
Ashfield25-Apr-09 7:34 
Questionhow to select mulitiple files for upload Pin
T_Teef23-Apr-09 10:10
T_Teef23-Apr-09 10:10 
AnswerRe: how to select mulitiple files for upload Pin
Christian Graus23-Apr-09 10:21
protectorChristian Graus23-Apr-09 10:21 
QuestionProcess.Start is eating spaces Pin
Miszou23-Apr-09 10:06
Miszou23-Apr-09 10:06 
I am trying to launch a Google search for a specific string from with my application, and this is all working perfectly, until the search string contains quotes. If there are quotes in the search string, then all the spaces inside the string are removed.

In the debugger, the string looks like this:

http://www.google.com/search?hl=en&q="Just For Laughs Comedy Tour"

But when Google gets it, the URL looks like this:

http://www.google.com/search?hl=en&q="JustForLaughsComedyTour"

If there are no quotes around the search string, then it works perfectly. Running it from the command line doesn't work at all unless I remove the quotes around the search string and place them around the entire command.

The code I am using is here:

System.Diagnostics.ProcessStartInfo pInfo = new System.Diagnostics.ProcessStartInfo(strCmd, strArgs);<br />
pInfo.Verb = "open";<br />
pInfo.ErrorDialog = true;<br />
pInfo.WorkingDirectory = strDir;<br />
System.Diagnostics.Process.Start(pInfo);


I realize that I could probably UrlEncode the string or something, but I am using a generic application launcher thingie that doesn't know anything about the application it is launching - it just calls start on whatever string you pass it. Actually, it is a version of the Visual Studio "External Tools" manager that I wrote[^] as a .NET control, so I don't want it to have to treat URLs differently to standard commands, and I don't want the command to be "IExplore.exe" either. I want it to launch the users default browser based on a URL that I give it.

Does anyone know how to workaround this quoted search string weirdness, without having to resort to a special case to fix it?

Thanks!


AnswerRe: Process.Start is eating spaces Pin
fly90423-Apr-09 12:04
fly90423-Apr-09 12:04 
GeneralRe: Process.Start is eating spaces Pin
Miszou23-Apr-09 13:23
Miszou23-Apr-09 13:23 
GeneralRe: Process.Start is eating spaces Pin
fly90423-Apr-09 15:23
fly90423-Apr-09 15:23 
Questionurl issue Pin
Zafar Sultan23-Apr-09 7:18
Zafar Sultan23-Apr-09 7:18 
AnswerRe: url issue Pin
Christian Graus23-Apr-09 11:02
protectorChristian Graus23-Apr-09 11:02 
QuestionCannot connect into SQL Server using C# Pin
Gindi Bar Yahav23-Apr-09 6:46
Gindi Bar Yahav23-Apr-09 6:46 
AnswerRe: Cannot connect into SQL Server using C# Pin
Eddy Vluggen23-Apr-09 6:49
professionalEddy Vluggen23-Apr-09 6:49 
GeneralRe: Cannot connect into SQL Server using C# Pin
Gindi Bar Yahav23-Apr-09 6:58
Gindi Bar Yahav23-Apr-09 6:58 
AnswerRe: Cannot connect into SQL Server using C# Pin
Eddy Vluggen23-Apr-09 7:18
professionalEddy Vluggen23-Apr-09 7:18 
GeneralRe: Cannot connect into SQL Server using C# Pin
Gindi Bar Yahav23-Apr-09 7:28
Gindi Bar Yahav23-Apr-09 7:28 
GeneralRe: Cannot connect into SQL Server using C# Pin
Eddy Vluggen23-Apr-09 8:47
professionalEddy Vluggen23-Apr-09 8:47 
AnswerRe: Cannot connect into SQL Server using C# Pin
SayreCC23-Apr-09 15:41
SayreCC23-Apr-09 15:41 
GeneralRe: Cannot connect into SQL Server using C# Pin
Gindi Bar Yahav23-Apr-09 22:56
Gindi Bar Yahav23-Apr-09 22:56 
QuestionXML Serialisation on Circular Dependency Pin
EnlilCox23-Apr-09 6:19
EnlilCox23-Apr-09 6:19 
AnswerRe: XML Serialisation on Circular Dependency Pin
Le centriste23-Apr-09 9:10
Le centriste23-Apr-09 9:10 
GeneralRe: XML Serialisation on Circular Dependency Pin
EnlilCox23-Apr-09 22:13
EnlilCox23-Apr-09 22:13 
GeneralRe: XML Serialisation on Circular Dependency Pin
Le centriste24-Apr-09 2:30
Le centriste24-Apr-09 2:30 

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.