本文整理汇总了C#中System.Web.HttpRequest.MapPath方法的典型用法代码示例。如果您正苦于以下问题:C# HttpRequest.MapPath方法的具体用法?C# HttpRequest.MapPath怎么用?C# HttpRequest.MapPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.HttpRequest
的用法示例。
在下文中一共展示了HttpRequest.MapPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddTalentDocument
public static int AddTalentDocument(HttpRequest req, ref string message, ref string forwardurl)
{
if (req.Files[0].ContentLength != 0)
{
Model.TB_RC_TalentDocument model = new Model.TB_RC_TalentDocument();
model.TD_CB_No = Convert.ToInt32(Common.Constants.getReqValue(req, "CB_No"));
model.TD_TI_No = Convert.ToInt32(Common.Constants.getReqValue(req, "TI_No"));
forwardurl = "TalentInfo/TalentDocument.aspx?CB_No=" + model.TD_CB_No + "&TI_No=" + model.TD_TI_No;
var tmpext = Common.Constants.GetFileExt(req.Files[0].FileName);
string filedir = req.MapPath("newImages") + "\\";
string filename = DateTime.Now.ToString("yyyy-MM-dd_HH_mm_ss") + Common.Constants.getGuid() + "." + tmpext;
req.Files[0].SaveAs(filedir + filename);
model.TD_DocName = System.IO.Path.GetFileName(req.Files[0].FileName);
model.TD_docPath = filename;
model.TD_CreateDate = DateTime.Now;
model.TD_CreatePer = "";
tddb.Add(model);
message = "添加文档成功";
}
else
{
message = "文件内容为空" ;
return Common.Constants.ERR;
}
return Common.Constants.OK;
}
示例2: SaveUploadedFileCollection
public static string SaveUploadedFileCollection (HttpRequest request, string fieldName, string fileName)
{
IEnumerator enumerator = request.Files.GetEnumerator();
StringBuilder filePathStringBuilder = new StringBuilder();
string path = request.MapPath(fileName);
try
{
if (!Directory.Exists(path))
{
DirectoryInfo directory = Directory.CreateDirectory(path);
}
for (int i = 0; enumerator.MoveNext(); i++)
{
string hash = new HashcodeGenerator(request.Files[i].InputStream).GetHashCode().ToString();
string filePath = String.Format("{0}/{1}{2}", path, hash, Path.GetExtension(request.Files[i].FileName));
request.Files[i].SaveAs(filePath);
filePathStringBuilder.Append(String.Format("{0}:{1},", Path.GetFileName(filePath), request.Files[fieldName].ContentType));
}
return filePathStringBuilder.ToString();
}
catch (Exception e)
{
return e.Message;
}
}
示例3: BeginProcessRequest
public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData)
{
m_request = context.Request;
m_response = context.Response;
m_cookieCollection = context.Request.Cookies;
m_asyncResult = new NuxleusAsyncResult(cb, extraData);
HttpCookie sessionid = m_cookieCollection["sessionid"];
HttpCookie userid = m_cookieCollection["userid"];
HttpCookie username = m_cookieCollection["username"];
HttpCookie name = m_cookieCollection["name"];
HttpCookie uservalidated = m_cookieCollection["uservalidated"];
string ip = m_request.UserHostAddress.ToString();
NameValueCollection form = m_request.Form;
m_returnLocation = form.Get("return-url");
//string collection_id = form.Get("collection-id");
string collection_name = form.Get("collection-name");
string collection_id = Guid.NewGuid().ToString();
string path = m_request.MapPath(String.Format("/member/{0}/media/{1}", userid.Value, collection_id));
if (!Directory.Exists(path))
{
DirectoryInfo directory = Directory.CreateDirectory(path);
}
List<AwsSdbModel.Attribute> attributes = new List<AwsSdbModel.Attribute>();
attributes.Add(new AwsSdbModel.Attribute { Name = "CollectionName", Value = collection_name });
attributes.Add(new AwsSdbModel.Attribute { Name = "CollectionOwner", Value = userid.Value });
PutAttributesTask task = new PutAttributesTask {
DomainName = new Domain {
Name = "collections" },
Item = new Item {
ItemName = collection_id,
Attribute = attributes
}
};
IResponse response = task.Invoke();
PutAttributesResult result = (PutAttributesResult)response.Result;
foreach (string header in response.Headers)
{
m_response.Write(String.Format("ResponseHeader: {0}: {1}", header, response.Headers[header]));
}
//m_response.Write(result.Metadata.RequestId);
WriteDebugXmlToOutputStream(attributes);
m_asyncResult.CompleteCall();
return m_asyncResult;
}
示例4: StreamLocalFile
public static void StreamLocalFile(string filepath, string contentType, HttpResponse response, HttpRequest request)
{
string fullpath = HttpContext.Current.Server.MapPath(filepath);
string fullpath2 = request.MapPath(filepath);
if (contentType.Length > 0)
{
// Set content type
response.ContentType = "application/json";
}
// Cheap and cheerful - not very efficient
// Write content as text to prevent having to worry about character encoding
string content = File.ReadAllText(fullpath);
response.Write(content);
}
示例5: IsLoginPage
private bool IsLoginPage(HttpRequest request)
{
try
{
var loginUrl = _configuration.LoginUrl;
if (!loginUrl.StartsWith("/", StringComparison.Ordinal) && !loginUrl.StartsWith("~/"))
{
loginUrl = "~/" + loginUrl;
}
return string.Equals(request.PhysicalPath, request.MapPath(loginUrl), StringComparison.OrdinalIgnoreCase);
}
catch
{
return false; // Cannot risk it. If any exception is thrown, err on the safe side: assume it's not the login page.
}
}
示例6: VirtualPathExistsPhysically
/// <summary>
/// Determines if a virtual path exists physically.
/// </summary>
/// <param name="virtualPath">A virtual path. For example "~/hello/world/foo.aspx".</param>
/// <param name="request">The <see cref="HttpRequest"/> used to verify the virtual path's
/// existance.</param>
/// <returns>True if the virtual path has a corresponding physical path that exists.</returns>
public static bool VirtualPathExistsPhysically(string virtualPath, HttpRequest request)
{
string physicalPath = request.MapPath(virtualPath);
return File.Exists(physicalPath);
}
示例7: Compress
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="response"></param>
public void Compress(HttpRequest request, HttpResponse response)
{
Encoding encoding = Encoding.GetEncoding("windows-1252");
string enc, cacheFile = null, cacheKey = null, content = "";
StringWriter writer = new StringWriter();
byte[] buff = new byte[1024];
GZipOutputStream gzipStream;
bool supportsGzip;
// Set response headers
response.ContentType = "text/javascript";
response.Charset = this.charset;
response.Buffer = false;
// Setup cache
response.Cache.SetExpires(DateTime.Now.AddSeconds(this.ExpiresOffset));
// Check if it supports gzip
enc = Regex.Replace("" + request.Headers["Accept-Encoding"], @"\s+", "").ToLower();
supportsGzip = enc.IndexOf("gzip") != -1 || request.Headers["---------------"] != null;
enc = enc.IndexOf("x-gzip") != -1 ? "x-gzip" : "gzip";
// Setup cache info
if (this.diskCache) {
cacheKey = "";
foreach (JSCompressItem item in this.items) {
// Get last mod
if (item.Type == JSItemType.File) {
DateTime fileMod = File.GetLastWriteTime(request.MapPath(item.Value));
if (fileMod > this.lastUpdate)
this.lastUpdate = fileMod;
}
cacheKey += item.Value;
}
cacheKey = this.cacheFileName != null ? this.cacheFileName : MD5(cacheKey);
if (this.gzipCompress)
cacheFile = request.MapPath(this.cacheDir + "/" + cacheKey + ".gz");
else
cacheFile = request.MapPath(this.cacheDir + "/" + cacheKey + ".js");
}
// Use cached file disk cache
if (this.diskCache && supportsGzip && File.Exists(cacheFile) && this.lastUpdate == File.GetLastWriteTime(cacheFile)) {
if (this.gzipCompress)
response.AppendHeader("Content-Encoding", enc);
response.WriteFile(cacheFile);
return;
}
foreach (JSCompressItem item in this.items) {
if (item.Type == JSItemType.File) {
if (!File.Exists(request.MapPath(item.Value))) {
writer.WriteLine("alert('Could not load file: " + StringUtils.Escape(item.Value) + "');");
continue;
}
StreamReader reader = new StreamReader(File.OpenRead(request.MapPath(item.Value)), System.Text.Encoding.UTF8);
if (item.RemoveWhiteSpace) {
JavaScriptMinifier jsMin = new JavaScriptMinifier(reader, writer);
jsMin.Compress();
} else {
writer.Write('\n');
writer.Write(reader.ReadToEnd());
writer.Write(";\n");
}
reader.Close();
} else {
if (item.RemoveWhiteSpace) {
JavaScriptMinifier jsMin = new JavaScriptMinifier(new StringReader(item.Value), writer);
jsMin.Compress();
} else {
writer.Write('\n');
writer.Write(item.Value);
writer.Write('\n');
}
}
}
content = writer.ToString();
// Generate GZIP'd content
if (supportsGzip) {
if (this.gzipCompress)
response.AppendHeader("Content-Encoding", enc);
if (this.diskCache && cacheKey != null) {
try {
//.........这里部分代码省略.........
示例8: GetAbsoluteServerPath
/// <summary>
/// Gets the absolute server path.
/// </summary>
/// <param name="Request">The request.</param>
/// <returns>absolute server path</returns>
public static string GetAbsoluteServerPath(HttpRequest Request)
{
string strServerPath;
strServerPath = Request.MapPath(Request.ApplicationPath);
if (!strServerPath.EndsWith("\\"))
{
strServerPath += "\\";
}
return strServerPath;
}
示例9: FindBuildProviderForPhysicalPath
static BuildProvider FindBuildProviderForPhysicalPath (string path, BuildProviderGroup group, HttpRequest req)
{
if (req == null || String.IsNullOrEmpty (path))
return null;
foreach (BuildProvider bp in group) {
if (String.Compare (path, req.MapPath (bp.VirtualPath), RuntimeHelpers.StringComparison) == 0)
return bp;
}
return null;
}
示例10: UpdateTalentInfoBasic
public static int UpdateTalentInfoBasic(HttpRequest req, ref string message)
{
string tmp = Common.Constants.getReqValue(req, "CB_No");
Model.TB_CG_CityBase model = cbdb.GetModel(Convert.ToInt32(tmp));
if (req.Files[0].ContentLength != 0)
{
System.Drawing.Image image = null;
System.Drawing.Image hb = null;
System.Drawing.Graphics g = null;
try
{
var tmpext = Common.Constants.GetFileExt(req.Files[0].FileName);
//req.Files[0].SaveAs(req.MapPath("../newImages") + "\\" + tparfs.TP_TeamImag);
string filedir = req.MapPath("newImages") + "\\";
string filename = tmp + "." + tmpext;
req.Files[0].SaveAs(filedir + filename);
image = System.Drawing.Image.FromFile(filedir + filename, false);
//System.Drawing.Image newimage = image.GetThumbnailImage(700, 400, null, new IntPtr());
double dVal = image.Width / 139.00;
hb = new System.Drawing.Bitmap(139, (int)(image.Height / dVal));//创建图片对象
g = System.Drawing.Graphics.FromImage(hb);//创建画板并加载空白图像
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;//设置保真模式为高度保真
g.DrawImage(image, new Rectangle(0, 0, 139, (int)(image.Height / dVal)), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel);//开始画图
//2013-10-15注释
//model.CB_Img = "sl." + filename;
//hb.Save(filedir + "\\" + model.CB_Img);
}
finally
{
image.Dispose();
g.Dispose();
hb.Dispose();
}
}
model.CB_X = Common.Constants.getReqValue(req, "CB_X");
model.CB_Y = Common.Constants.getReqValue(req, "CB_Y");
model.CB_Name = Common.Constants.getReqValue(req, "CB_Name");
model.cb_shopnum = Common.Constants.getReqValue(req, "CB_Num");
//tmp = Common.Constants.getReqValue(req, "CB_Num");
//if (tmp != "") model.CB_Num = int.Parse(tmp);
model.CB_Num = Common.Constants.getReqValue(req, "CB_Position");
model.cb_setup = Common.Constants.getReqValue(req, "CB_SetUp");
model.CB_Des = Common.Constants.getReqValue(req, "CB_Des");
model.CB_Je = Common.Constants.getReqValue(req, "CB_Je");
cbcrdb.Delete(model.CB_No);//删除原有的记录
var arrstr = Common.Constants.getReqValue(req, "TC_No");
string[] arr;
if (arrstr != "")
{
arr = arrstr.Split(',');
foreach (var cr in arr)
{
if (cr.Trim() != "")
{
var tmpModel = new Model.TB_CG_SocialWelfareLink() { CT_CB_No = model.CB_No, CT_TC_No = Convert.ToInt32(cr) };
if (!cbcrdb.Exists(tmpModel))
{
cbcrdb.Add(tmpModel);
}
}
}
}
cbdb.Update(model);
message = "更新公司成功";
return Common.Constants.OK;
}
示例11: Compress
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="response"></param>
public void Compress(HttpRequest request, HttpResponse response)
{
Encoding encoding = Encoding.GetEncoding("windows-1252");
string enc, cacheFile = null, cacheKey = null, content = "";
StringWriter writer = new StringWriter();
byte[] buff = new byte[1024];
GZipOutputStream gzipStream;
bool supportsGzip;
// Set response headers
response.ContentType = "text/css";
response.Charset = this.charset;
response.Buffer = false;
// Setup cache
response.Cache.SetExpires(DateTime.Now.AddSeconds(this.ExpiresOffset));
// Check if it supports gzip
enc = Regex.Replace("" + request.Headers["Accept-Encoding"], @"\s+", "").ToLower();
supportsGzip = enc.IndexOf("gzip") != -1 || request.Headers["---------------"] != null;
enc = enc.IndexOf("x-gzip") != -1 ? "x-gzip" : "gzip";
// Setup cache info
if (this.diskCache) {
cacheKey = "";
foreach (CSSCompressItem item in this.items) {
// Get last mod
if (item.Type == CSSItemType.File) {
DateTime fileMod = File.GetLastWriteTime(request.MapPath(item.Value));
if (fileMod > this.lastUpdate)
this.lastUpdate = fileMod;
}
cacheKey += item.Value;
}
cacheKey = this.cacheFileName != null ? this.cacheFileName : MD5(cacheKey);
if (this.gzipCompress)
cacheFile = request.MapPath(this.cacheDir + "/" + cacheKey + ".gz");
else
cacheFile = request.MapPath(this.cacheDir + "/" + cacheKey + ".css");
}
// Use cached file disk cache
if (this.diskCache && supportsGzip && File.Exists(cacheFile) && this.lastUpdate == File.GetLastWriteTime(cacheFile)) {
if (this.gzipCompress)
response.AppendHeader("Content-Encoding", enc);
response.WriteFile(cacheFile);
return;
}
foreach (CSSCompressItem item in this.items) {
if (item.Type == CSSItemType.File) {
StreamReader reader = new StreamReader(File.OpenRead(request.MapPath(item.Value)), System.Text.Encoding.UTF8);
string data;
if (item.RemoveWhiteSpace)
data = this.TrimWhiteSpace(reader.ReadToEnd());
else
data = reader.ReadToEnd();
if (this.convertUrls)
data = Regex.Replace(data, "url\\(['\"]?(?!\\/|http)", "$0" + PathUtils.ToUnixPath(Path.GetDirectoryName(item.Value)) + "/");
writer.Write(data);
reader.Close();
} else {
if (item.RemoveWhiteSpace)
writer.Write(this.TrimWhiteSpace(item.Value));
else
writer.Write(item.Value);
}
}
content = writer.ToString();
// Generate GZIP'd content
if (supportsGzip) {
if (this.gzipCompress)
response.AppendHeader("Content-Encoding", enc);
if (this.diskCache && cacheKey != null) {
try {
// Gzip compress
if (this.gzipCompress) {
gzipStream = new GZipOutputStream(File.Create(cacheFile));
buff = encoding.GetBytes(content.ToCharArray());
gzipStream.Write(buff, 0, buff.Length);
gzipStream.Close();
//.........这里部分代码省略.........
示例12: GetRealLocation
private static string GetRealLocation(HttpRequest request, string virtualPath)
{
return request.MapPath(virtualPath);
}
示例13: Process
protected override void Process(HttpRequest request, HttpResponse response)
{
var narnoo_video_shortcode_count = request.Form["narnoo_video_shortcode_count"];
var id = request.Form["video_id"];
var width = request.Form["width"];
var height = request.Form["height"];
var operator_id = request.Form["operator_id"];
Video video = null;
// request video details from API
if (operator_id.HasValue())
{
try
{
video = this.NarnooOperatorMediaRequest.GetVideoDetails(operator_id,id);
}
catch (Exception ex)
{
response.Write(serializer.Serialize(new { response = ex.Message }));
return;
}
}
else
{
try
{
video = this.NarnooMediaRequest.GetVideoDetails(id);
}
catch (Exception ex)
{
response.Write(serializer.Serialize(new { response = ex.Message }));
return;
}
}
var pause_image_dir = request.MapPath("/umbraco/narnoo/temp/tmp_pause_img/"); // relative directory containing temporary pause images
if (Directory.Exists(pause_image_dir) == false)
{
Directory.CreateDirectory(pause_image_dir);
}
// need to download pause image to local server, in order to pass to flashvars
// first we delete all previously downloaded pause image files older than 5 minutes
foreach (var file in Directory.GetFiles(pause_image_dir))
{
var info = new FileInfo(file);
if (info.LastWriteTime.AddMinutes(5) < DateTime.Now)
{
File.Delete(file);
}
}
Uri uri = new Uri(video.video_pause_image_path);
string pause_image_filename = System.IO.Path.GetFileName(uri.LocalPath);
var pause_image_fileurl = "/umbarco/narnoo/temp/tmp_pause_img/" + pause_image_filename;
var pause_image_filepath = request.MapPath(pause_image_fileurl);
var client = new WebClient();
// Response.AddHeader("content-disposition", "attachment; filename=" + vide);
client.DownloadFile(video.video_pause_image_path, pause_image_filepath);
var content = "<script type='text/javascript'>"
+ "narnoo_video.flashvars[" + narnoo_video_shortcode_count + "].swfMovie = encodeURIComponent('" + HttpUtility.HtmlDecode(Utilities.DecodeCData(video.video_stream_path)) + "');"
+ "narnoo_video.flashvars[" + narnoo_video_shortcode_count + "].swfMovieHQ = encodeURIComponent('" + HttpUtility.HtmlDecode(Utilities.DecodeCData(video.video_hqstream_path)) + "');"
+ "narnoo_video.flashvars[" + narnoo_video_shortcode_count + "].swfThumb = encodeURIComponent('" + pause_image_fileurl + "');"
+ "</script>"
+ "<video width='" + width + "' height='" + height + "' controls='controls' poster='" + pause_image_fileurl + "'>"
+ " <source src='" + HttpUtility.HtmlDecode(Utilities.DecodeCData(video.video_stream_path)) + "' type='video/mp4' />"
+ " <source src='" + HttpUtility.HtmlDecode(Utilities.DecodeCData(video.video_webm_path)) + "' type='video/webm' />"
+ " Your browser does not support the html5 video tag."
+ "</video>";
response.Write(serializer.Serialize(new { response = content }));
}
示例14: Saved
public override void Saved(HttpRequest request, string actualPath, string vpath)
{
#region arguments
if (request == null)
{
throw new ArgumentNullException("request");
}
#endregion
// once the template has been uploaded.
// unzip the files and delete the uploaded file
string templateName = request["uploadtemplatename"];
string templateUrlPath = request["uploadtemplateurlPath"];
if (string.IsNullOrEmpty(templateName))
{
templateName = Constants.DefaultTemplateName;
}
if (string.IsNullOrEmpty(templateUrlPath))
{
templateUrlPath = Constants.RootUrl;
}
//get the virtual path of the template extraction
string templateVirtualPath = TemplatePlugin.GetTemplateVirtualPath(templateName);
//convert virtual path to real path
string templateExtractPath = request.MapPath(templateVirtualPath);
logger.Log(LogLevel.Debug, "Template file uploaded at : {0}.", actualPath);
try
{
string master = null;
using (ZipFile zip = ZipFile.Read(actualPath))
{
master = GetMasterFileName(zip);
if (Directory.Exists(templateExtractPath))
{
logger.Log(LogLevel.Info, "Cleaning folder {0}.", templateExtractPath);
Directory.Delete(templateExtractPath, true);
}
// create or empty the existing template data
if (!Directory.Exists(templateExtractPath))
{
logger.Log(LogLevel.Info, "Creating folder {0}.", templateExtractPath);
Directory.CreateDirectory(templateExtractPath);
}
logger.Log(LogLevel.Info, "Extracting template at folder {0}.", templateExtractPath);
foreach (ZipEntry entry in zip)
{
entry.Extract(templateExtractPath, ExtractExistingFileAction.OverwriteSilently);
}
}
// save the template.
Template template = TemplatePlugin.Instance.GetTemplateUrlPath(templateUrlPath);
Template newTemplate = new Template()
{
Name = templateName,
TemplatePath = templateName,
MasterFileName = master,
UrlPath = templateUrlPath
};
if (template != null)
{
//delete the existing template.
TemplatePlugin.Instance.Delete(template.UId);
}
TemplatePlugin.Instance.Add(newTemplate);
Dictionary<string, object> properties = new Dictionary<string, object>(1);
properties["Id"] = newTemplate.Id;
this.Properties = properties;
this.Success = true;
}
finally
{
//delete the uploaded zip file
this.DeleteUploaded = true;
}
}
示例15: BeginProcessRequest
public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData)
{
m_request = context.Request;
m_response = context.Response;
m_cookieCollection = context.Request.Cookies;
m_asyncResult = new NuxleusAsyncResult(cb, extraData);
HttpCookie sessionid = m_cookieCollection["sessionid"];
HttpCookie userid = m_cookieCollection["userid"];
HttpCookie username = m_cookieCollection["username"];
HttpCookie name = m_cookieCollection["name"];
HttpCookie uservalidated = m_cookieCollection["uservalidated"];
string ip = m_request.UserHostAddress.ToString();
NameValueCollection form = m_request.Form;
HttpFileCollection files = m_request.Files;
m_response.Write(files.Count);
m_returnLocation = form.Get("return-url");
string medianame = form.Get("name");
string description = form.Get("description");
string collection_name = form.Get("collection-name");
string collection_id = form.Get("collection-id");
string tags = form.Get("tags");
string mediaid = Guid.NewGuid().ToString();
string virtualPath = String.Format("/member/{0}/media/{1}", userid.Value, collection_id);
string path = m_request.MapPath(virtualPath);
for (int i = 0; i < files.Count; i++)
{
HttpPostedFile postedFile = files[i];
string localFilePath = String.Empty;
try
{
if (!Directory.Exists(path))
{
DirectoryInfo directory = Directory.CreateDirectory(path);
}
Stream fileStream = postedFile.InputStream;
string hash = new HashcodeGenerator(fileStream).GetHashCode().ToString();
string fileName = String.Format("{0}{1}", hash, Path.GetExtension(postedFile.FileName));
localFilePath = String.Format("{0}\\{1}", path, fileName);
postedFile.SaveAs(localFilePath);
string uri = String.Format("{0}{1}/{2}", m_baseMediaDomain, virtualPath, fileName);
List<AwsSdbModel.Attribute> attributes = new List<AwsSdbModel.Attribute>();
attributes.Add(new AwsSdbModel.Attribute { Name = "medianame", Value = medianame });
attributes.Add(new AwsSdbModel.Attribute { Name = "description", Value = description });
attributes.Add(new AwsSdbModel.Attribute { Name = "tags", Value = tags });
attributes.Add(new AwsSdbModel.Attribute { Name = "CollectionName", Value = collection_name });
attributes.Add(new AwsSdbModel.Attribute { Name = "CollectionId", Value = collection_id });
attributes.Add(new AwsSdbModel.Attribute { Name = "mediaid", Value = mediaid });
attributes.Add(new AwsSdbModel.Attribute { Name = "uri", Value = uri });
attributes.Add(new AwsSdbModel.Attribute { Name = "mediacreator", Value = userid.Value });
PutAttributesTask task = new PutAttributesTask {
DomainName = new Domain {
Name = "media" },
Item = new Item {
ItemName = mediaid,
Attribute = attributes
}
};
IResponse response = task.Invoke();
PutAttributesResult result = (PutAttributesResult)response.Result;
foreach (string header in response.Headers)
{
m_response.Write(String.Format("ResponseHeader: {0}: {1}", header, response.Headers[header]));
}
WriteDebugXmlToOutputStream(attributes);
}
catch (Exception e)
{
m_response.Write(e.Message);
}
}
m_asyncResult.CompleteCall();
return m_asyncResult;
}