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

C#

 
QuestionNeed Basic Silverlight Projects Pin
Rajkumar Kothandapani20-Sep-13 17:46
Rajkumar Kothandapani20-Sep-13 17:46 
AnswerRe: Need Basic Silverlight Projects Pin
codestar00720-Sep-13 18:59
professionalcodestar00720-Sep-13 18:59 
AnswerRe: Need Basic Silverlight Projects Pin
Abhinav S22-Sep-13 3:44
Abhinav S22-Sep-13 3:44 
QuestionPreventing DOM based XSS Script PROBLEM -with details- Pin
computer_programmer120-Sep-13 8:05
computer_programmer120-Sep-13 8:05 
AnswerRe: Preventing DOM based XSS Script PROBLEM -with details- Pin
Keld Ølykke23-Sep-13 19:59
Keld Ølykke23-Sep-13 19:59 
Questioncheck box in repeater Pin
ravitejsrivastava20-Sep-13 6:32
ravitejsrivastava20-Sep-13 6:32 
AnswerRe: check box in repeater Pin
NotPolitcallyCorrect20-Sep-13 7:36
NotPolitcallyCorrect20-Sep-13 7:36 
QuestionLooking for help in querying web page values with C sharp Pin
turbosupramk320-Sep-13 5:28
turbosupramk320-Sep-13 5:28 
I am very familiar with C sharp, but have not ever tried to do anything with Aspx/Silverlight and c sharp, so I'm a totally new to that.

For an exercise, I would like to query the company time entry website (Aspx and Silverlight on the front end), specifically the vacation hours value with a test form in C sharp.

Besides login credentials and the url, what do I need for this and how can I do this? I tried the code below, but it did not do anything.

Thanks for reading.


private void btnTest_Click(object sender, EventArgs e)
        {
            try
            {
                // Create a request for the URL. 
                WebRequest request = WebRequest.Create (
                  "https://time.website.com/pa/application.aspx#/TimesheetEntry");
                // If required by the server, set the credentials.
                request.Credentials = new System.Net.NetworkCredential("username", "password", "domain");
                //request.Credentials = CredentialCache.DefaultCredentials;
                // Get the response.
                WebResponse response = request.GetResponse ();
                // Display the status.
                lbxValues.Text += ((HttpWebResponse)response).StatusDescription;
                //Console.WriteLine(((HttpWebResponse)response).StatusDescription);
                // Get the stream containing content returned by the server.
                Stream dataStream = response.GetResponseStream ();
                // Open the stream using a StreamReader for easy access.
                StreamReader reader = new StreamReader (dataStream);
                // Read the content.
                string responseFromServer = reader.ReadToEnd ();
                // Display the content.
                lbxValues.Text += (responseFromServer);
                //Console.WriteLine (responseFromServer);
                // Clean up the streams and the response.
                reader.Close ();
                response.Close ();
            }   
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + System.Environment.NewLine + ex.Source + System.Environment.NewLine + ex.TargetSite + System.Environment.NewLine + ex.StackTrace + System.Environment.NewLine + System.Environment.NewLine);
            }
        }

AnswerRe: Looking for help in querying web page values with C sharp Pin
turbosupramk323-Sep-13 2:55
turbosupramk323-Sep-13 2:55 
QuestionDetect a particular color in particular location from image in c# Pin
Member 402509119-Sep-13 22:20
Member 402509119-Sep-13 22:20 
AnswerRe: Detect a particular color in particular location from image in c# Pin
Richard MacCutchan20-Sep-13 1:54
mveRichard MacCutchan20-Sep-13 1:54 
AnswerRe: Detect a particular color in particular location from image in c# Pin
Abhinav S20-Sep-13 3:16
Abhinav S20-Sep-13 3:16 
AnswerRe: Detect a particular color in particular location from image in c# Pin
BillWoodruff20-Sep-13 7:46
professionalBillWoodruff20-Sep-13 7:46 
GeneralRe: Detect a particular color in particular location from image in c# Pin
shehrozeee22-Sep-13 0:17
shehrozeee22-Sep-13 0:17 
GeneralRe: Detect a particular color in particular location from image in c# Pin
Dave Kreskowiak22-Sep-13 3:34
mveDave Kreskowiak22-Sep-13 3:34 
Questionhow to use thread in for loop in c# Pin
superselector19-Sep-13 20:00
superselector19-Sep-13 20:00 
AnswerRe: how to use thread in for loop in c# Pin
Mycroft Holmes19-Sep-13 21:06
professionalMycroft Holmes19-Sep-13 21:06 
GeneralRe: how to use thread in for loop in c# Pin
superselector19-Sep-13 21:50
superselector19-Sep-13 21:50 
GeneralRe: how to use thread in for loop in c# Pin
GuyThiebaut19-Sep-13 22:20
professionalGuyThiebaut19-Sep-13 22:20 
GeneralRe: how to use thread in for loop in c# Pin
superselector19-Sep-13 23:08
superselector19-Sep-13 23:08 
GeneralRe: how to use thread in for loop in c# Pin
GuyThiebaut19-Sep-13 23:13
professionalGuyThiebaut19-Sep-13 23:13 
GeneralRe: how to use thread in for loop in c# Pin
Pete O'Hanlon19-Sep-13 22:34
mvePete O'Hanlon19-Sep-13 22:34 
GeneralRe: how to use thread in for loop in c# Pin
harold aptroot19-Sep-13 23:58
harold aptroot19-Sep-13 23:58 
GeneralRe: how to use thread in for loop in c# Pin
superselector23-Sep-13 18:51
superselector23-Sep-13 18:51 
GeneralRe: how to use thread in for loop in c# Pin
harold aptroot23-Sep-13 21:08
harold aptroot23-Sep-13 21:08 

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.