|
Revision 3949, 0.9 kB
(checked in by xmlhacker, 1 year ago)
|
addition of the base application source
|
| Line | |
|---|
| 1 |
using System; |
|---|
| 2 |
using System.Diagnostics; |
|---|
| 3 |
using System.Web; |
|---|
| 4 |
|
|---|
| 5 |
namespace Xameleon.Function |
|---|
| 6 |
{ |
|---|
| 7 |
|
|---|
| 8 |
public class HttpResponseCollection |
|---|
| 9 |
{ |
|---|
| 10 |
|
|---|
| 11 |
public static void SetValue(HttpResponse response, string type, string key, string value) |
|---|
| 12 |
{ |
|---|
| 13 |
try |
|---|
| 14 |
{ |
|---|
| 15 |
switch (type) |
|---|
| 16 |
{ |
|---|
| 17 |
case "cookie": |
|---|
| 18 |
HttpCookie cookie = new HttpCookie(key, value); |
|---|
| 19 |
response.Cookies.Set(cookie); |
|---|
| 20 |
break; |
|---|
| 21 |
case "headers": |
|---|
| 22 |
response.AppendHeader(key, value); |
|---|
| 23 |
break; |
|---|
| 24 |
default: |
|---|
| 25 |
break; |
|---|
| 26 |
} |
|---|
| 27 |
} |
|---|
| 28 |
catch (Exception e) |
|---|
| 29 |
{ |
|---|
| 30 |
Debug.WriteLine("Error: " + e.Message); |
|---|
| 31 |
} |
|---|
| 32 |
} |
|---|
| 33 |
} |
|---|
| 34 |
} |
|---|
| 35 |
|
|---|
| 36 |
|
|---|