Click here to Skip to main content
15,907,236 members
Home / Discussions / C#
   

C#

 
GeneralRe: Making Excel Cells Read Only Pin
dpasswat17-Feb-17 10:21
dpasswat17-Feb-17 10:21 
GeneralRe: Making Excel Cells Read Only Pin
Patrice T17-Feb-17 11:24
mvePatrice T17-Feb-17 11:24 
AnswerRe: Making Excel Cells Read Only Pin
Ralf Meier16-Feb-17 19:18
mveRalf Meier16-Feb-17 19:18 
GeneralRe: Making Excel Cells Read Only Pin
dpasswat17-Feb-17 10:25
dpasswat17-Feb-17 10:25 
Questionhow to convert pdf to xml? Pin
Member 1275769515-Feb-17 4:04
Member 1275769515-Feb-17 4:04 
AnswerRe: how to convert pdf to xml? Pin
Nathan Minier15-Feb-17 4:27
professionalNathan Minier15-Feb-17 4:27 
SuggestionRe: how to convert pdf to xml? Pin
Richard Deeming15-Feb-17 5:31
mveRichard Deeming15-Feb-17 5:31 
GeneralRe: how to convert pdf to xml? Pin
Nathan Minier15-Feb-17 5:49
professionalNathan Minier15-Feb-17 5:49 
Questionhow to making async call to proxy webreference created from asmx webservice Pin
ArunHanu15-Feb-17 2:25
ArunHanu15-Feb-17 2:25 
AnswerRe: how to making async call to proxy webreference created from asmx webservice Pin
Nathan Minier15-Feb-17 2:55
professionalNathan Minier15-Feb-17 2:55 
GeneralRe: how to making async call to proxy webreference created from asmx webservice Pin
ArunHanu15-Feb-17 3:06
ArunHanu15-Feb-17 3:06 
GeneralRe: how to making async call to proxy webreference created from asmx webservice Pin
Gerry Schmitz15-Feb-17 3:34
mveGerry Schmitz15-Feb-17 3:34 
GeneralRe: how to making async call to proxy webreference created from asmx webservice Pin
Nathan Minier15-Feb-17 4:24
professionalNathan Minier15-Feb-17 4:24 
GeneralRe: how to making async call to proxy webreference created from asmx webservice Pin
ArunHanu15-Feb-17 19:04
ArunHanu15-Feb-17 19:04 
GeneralRe: how to making async call to proxy webreference created from asmx webservice Pin
Nathan Minier16-Feb-17 1:00
professionalNathan Minier16-Feb-17 1:00 
GeneralRe: how to making async call to proxy webreference created from asmx webservice Pin
ArunHanu16-Feb-17 22:23
ArunHanu16-Feb-17 22:23 
Questionusing @ as Text for a link Pin
Member 1299330414-Feb-17 4:54
Member 1299330414-Feb-17 4:54 
AnswerRe: using @ as Text for a link Pin
OriginalGriff14-Feb-17 6:03
mveOriginalGriff14-Feb-17 6:03 
AnswerRe: using @ as Text for a link Pin
Richard MacCutchan14-Feb-17 6:31
mveRichard MacCutchan14-Feb-17 6:31 
AnswerRe: using @ as Text for a link Pin
Richard Deeming14-Feb-17 6:42
mveRichard Deeming14-Feb-17 6:42 
You used to be able to pass the username and password in the URL by using:
http://username:password@host/

However, this was an extremely bad idea.

Microsoft removed support for this from Internet Explorer 6 back in 2004:
Microsoft Security Bulletin MS04-004 - Critical[^]
Internet Explorer does not support user names and passwords in Web site addresses (HTTP or HTTPS URLs)[^]

Firefox still supports it, but displays a warning message:
Network.http.phishy-userpass-length - MozillaZine Knowledge Base[^]

Chrome tried to deprecate the feature back in 2012, but it looks like they were forced to turn it back on:
123150 - Chrome 19 doesn't respect basic auth details embedded in the URL - chromium - Monorail[^]

Behaviour in other browsers will vary. You can test your browser with the following URL:
https://foo:bar@httpbin.org/basic-auth/foo/bar[^]


Also, your code isn't building the correct URL. Your need:
C#
string mystring = "http://" + username + ":" + password + "@" + myip + "/command.htm?key=";

// Or:
string mystring = string.Format("http://{0}:{1}@{2}/command.htm?key=", username, password, myip);

// Or: (C# 6)
string mystring = $"http://{username}:{password}@{myip}/command.htm?key=";

Alternatively, use the UriBuilder class[^]:
C#
UriBuilder builder = new UriBuilder();
builder.UserName = username;
builder.Password = password;
builder.Host = myip;
builder.Path = "/command.htm";
builder.Query = "key=";
string mystring = builder.ToString();

But, as I said, the result of opening that URL will depend on your default browser.



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


Questionhow to jump to the particular section in a tab from different tab Pin
Dhyanga13-Feb-17 7:01
Dhyanga13-Feb-17 7:01 
AnswerRe: how to jump to the particular section in a tab from different tab Pin
Richard Deeming13-Feb-17 7:59
mveRichard Deeming13-Feb-17 7:59 
QuestionRead xml file from folder and extract data to database Pin
Member 1299751812-Feb-17 21:47
Member 1299751812-Feb-17 21:47 
AnswerRe: Read xml file from folder and extract data to database Pin
Pete O'Hanlon12-Feb-17 22:02
mvePete O'Hanlon12-Feb-17 22:02 
GeneralRe: Read xml file from folder and extract data to database Pin
Member 1299751813-Feb-17 7:51
Member 1299751813-Feb-17 7:51 

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.