Click here to Skip to main content
15,886,199 members
Home / Discussions / C#
   

C#

 
GeneralRe: image resizing Pin
vimalbala23-Mar-13 1:30
vimalbala23-Mar-13 1:30 
QuestionC# Money Transfer Question Pin
Jimmy173420-Feb-13 18:10
Jimmy173420-Feb-13 18:10 
QuestionRe: C# Money Transfer Question Pin
Eddy Vluggen21-Feb-13 8:40
professionalEddy Vluggen21-Feb-13 8:40 
QuestionMD5 hash encrypt and decryption Pin
thekoko8920-Feb-13 15:32
thekoko8920-Feb-13 15:32 
GeneralRe: MD5 hash encrypt and decryption Pin
PIEBALDconsult20-Feb-13 17:18
mvePIEBALDconsult20-Feb-13 17:18 
AnswerRe: MD5 hash encrypt and decryption Pin
Bernhard Hiller20-Feb-13 21:12
Bernhard Hiller20-Feb-13 21:12 
AnswerRe: MD5 hash encrypt and decryption Pin
Dave Kreskowiak21-Feb-13 2:34
mveDave Kreskowiak21-Feb-13 2:34 
QuestionPost a file to remote server using HTTPWEBREQUEST Pin
vanikanc20-Feb-13 9:07
vanikanc20-Feb-13 9:07 
Hello,

Below is a piece of code, where in I am trying to post a file from my pc to remote development server. For some reason it does not seem to be working. I don't see the file on the remote server.

private void button2_Click(object sender, EventArgs e)
{
    FileStream filetoupload = new FileStream("C:\\projects\\testfile.csv", FileMode.Open);
    Uri address = new Uri("http://devsrvr/hints/");

    HttpWebRequest webreq = HttpWebRequest.Create(address) as HttpWebRequest;

    // set type to post
    webreq.Method = "POST";
    webreq.ContentType = "application/x-www-form-urlencoded";
    webreq.Timeout = 15 * 1000;
    // data we want to send, which is pretty much a file

    byte[] bytedata = UTF8Encoding.UTF8.GetBytes(filetoupload.ToString());
    webreq.ContentLength = bytedata.Length;

    try
    {
        using (Stream poststream = webreq.GetRequestStream())
        {
            poststream.Write(bytedata, 0, bytedata.Length);
        }
        MessageBox.Show("done!!");
    }
    catch (Exception ex)
    {
        ex.InnerException.ToString();
        ex.Source.ToString();
        ex.Message.ToString();
    }
}

AnswerRe: Post a file to remote server using HTTPWEBREQUEST Pin
Eddy Vluggen20-Feb-13 9:51
professionalEddy Vluggen20-Feb-13 9:51 
GeneralRe: Post a file to remote server using HTTPWEBREQUEST Pin
vanikanc20-Feb-13 10:04
vanikanc20-Feb-13 10:04 
AnswerRe: Post a file to remote server using HTTPWEBREQUEST Pin
Eddy Vluggen20-Feb-13 10:13
professionalEddy Vluggen20-Feb-13 10:13 
GeneralRe: Post a file to remote server using HTTPWEBREQUEST Pin
vanikanc21-Feb-13 2:53
vanikanc21-Feb-13 2:53 
AnswerRe: Post a file to remote server using HTTPWEBREQUEST Pin
Pete O'Hanlon20-Feb-13 10:18
mvePete O'Hanlon20-Feb-13 10:18 
GeneralRe: Post a file to remote server using HTTPWEBREQUEST Pin
vanikanc21-Feb-13 2:49
vanikanc21-Feb-13 2:49 
Questionsource code for navigation Pin
Nani Maneesh20-Feb-13 7:07
Nani Maneesh20-Feb-13 7:07 
AnswerRe: source code for navigation Pin
Dave Kreskowiak20-Feb-13 7:38
mveDave Kreskowiak20-Feb-13 7:38 
GeneralRe: source code for navigation Pin
Jibesh20-Feb-13 8:32
professionalJibesh20-Feb-13 8:32 
GeneralRe: source code for navigation Pin
Dave Kreskowiak20-Feb-13 11:24
mveDave Kreskowiak20-Feb-13 11:24 
QuestionHow to Show GIF Image Transparent C# Pin
ishrar19-Feb-13 21:53
ishrar19-Feb-13 21:53 
AnswerRe: How to Show GIF Image Transparent C# Pin
Alan Balkany20-Feb-13 8:28
Alan Balkany20-Feb-13 8:28 
QuestionInstall software and menus depending upon radion button selection option used in MSI Pin
sjs4u19-Feb-13 19:33
sjs4u19-Feb-13 19:33 
AnswerRe: Install software and menus depending upon radion button selection option used in MSI Pin
Eddy Vluggen20-Feb-13 0:31
professionalEddy Vluggen20-Feb-13 0:31 
GeneralRe: Install software and menus depending upon radion button selection option used in MSI Pin
sjs4u20-Feb-13 18:12
sjs4u20-Feb-13 18:12 
GeneralRe: Install software and menus depending upon radion button selection option used in MSI Pin
Eddy Vluggen21-Feb-13 7:06
professionalEddy Vluggen21-Feb-13 7:06 
Questionproject Pin
pramodrastogi9119-Feb-13 18:14
pramodrastogi9119-Feb-13 18:14 

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.