1

ich have a little Problem to write a .net code. I have an example in java and want to convert it to .net!!

Java Code:

String url = "https://adwords.google.com/api/adwords/reportdownload?__rd="
    + reportDefinitionId;
 HttpURLConnection urlConn = 
    (HttpURLConnection) new URL(url).openConnection();
urlConn.setRequestMethod ("GET");
urlConn.setRequestProperty("Authorization", "GoogleLogin auth="
    + user.getRegisteredAuthToken());
if (user.getClientCustomerId() != null) {
  urlConn.setRequestProperty("clientCustomerId", user.getClientCustomerId());
} else if (user.getClientEmail() != null) {
  urlConn.setRequestProperty("clientEmail", user.getClientEmail());
} else {
  urlConn.setRequestProperty("clientEmail", user.getEmail());
}
urlConn.connect();
copyStream(urlConn.getInputStream(), new FileOutputStream(
    new File(outputFileName)));

Thank you for Help!! If you need more Information, please ask me Alexo

2
  • 1
    IKVM for the lazy... Commented Dec 3, 2010 at 12:29
  • 5
    You don't have to do his work. It's enough to give him pointers as the answers below. Why scare away new users? Just show them how it works here at SO.. Commented Dec 3, 2010 at 12:38

2 Answers 2

1

Take a look at the WebClient class

http://msdn.microsoft.com/en-us/library/system.net.webclient(VS.80).aspx

Sign up to request clarification or add additional context in comments.

Comments

0

You can see this post: http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_22691600.html

Regards!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.