hi im trying to convert java to c# now. trying to understand how to change this to C#.
first problem that i have met.
in java, httpConnection has the setRequestProperty and get HeaderField. however i cant find the equivalent for these in c# for cookie.
conn.setRequestProperty(
"cookie", mSession); String cookie = conn.getHeaderField("Set-cookie");
second problem that i have met. i have changed the getResponseCode() to getResonse() in C#. but i got an error Cannot implicitly convert type 'System.Net.WebResponse' to 'int'. also i am trying to convert HttpConnection.HTTP_OK, dataInputStream and OpenInputStream to c#, which i could nto find an equivalent.
int rc=0; //conn.getResponseCode();
try{
rc=conn.getResponseCode();
}catch(Exception e)
{System.out.println(e);}
System.out.println("rc have already"+conn.getResponseCode());
if(rc==HttpConnection.HTTP_OK) {
StringBuffer text=new StringBuffer();
try{
DataInputStream din=new DataInputStream(conn.openInputStream());
int n=din.readInt();
while(n-->0) {
text.append(din.readUTF());
text.append(' ');
}
}