您的位置:首页 > 其它

第一次发博哈我写的处理文章图片大小问题

2009-10-28 17:12 197 查看
第一次发博不知道写什么...我是新手上路哈...参加.NET实际开发快2个月了...

遇到了这么一个问题...用户图片上传的尺寸太大...所以就自己搞了段小垃圾代码搞定了...

第一次发博就发发这个吧...

看我这段话就知道我人有多单纯...嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻

string count= list[0].FxCount.ToString();//获取文章内容
string [] str=null;
int i = count.IndexOf("height", StringComparison.OrdinalIgnoreCase);
count = count.ToLower();
str = count.Split(' ');
string newAddress = "";
for (int j = 0; j < str.Length; j++)
{

if (str[j].IndexOf("height")>-1)
{
str[j] = "height=200 ";
}
if (str[j].IndexOf("width") > -1)
{
str[j] = "width=200 ";
}
// Response.Write("<script>alert('" + str[j].ToString() + "')</script>");
}

for (int m = 0; m < str.Length; m++)
{
newAddress=newAddress+str[m]+" ";
}

newAddress就是处理完的文章内容了...起错名好像....嘿嘿
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: