0

This works but I wanted to use the "using" keyword.

Stream st = null; st = request.GetRequestStream(); st.Write(bytes, 0, bytes.Length); st.Close(); 

How would I go about using the keyword "using" here?

using (Stream st = ...

0

1 Answer 1

5
using (Stream st = request.GetRequestStream()) { st.Write(bytes, 0, bytes.Length); } 
Sign up to request clarification or add additional context in comments.

1 Comment

that's all i needed. for some reason I was running into errors. then i realized it was just an extra parenthesis (my code has more parentheses by the sample code above) so i guess i just didn't see it. thx anyway!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.