Asp.net 更改youtube被盗用链接的内容
这是一个非常简单复杂的查询。我需要解决办法。我有一个youtube链接Asp.net 更改youtube被盗用链接的内容,asp.net,youtube,Asp.net,Youtube,这是一个非常简单复杂的查询。我需要解决办法。我有一个youtube链接 <----- width="480" height="350"><param name="movie" value="http://www.youtube.com/v/OORDOd6wRrE&hl=en_US&fs=1"></param><param name="allowFullScreen" value="true"></para
<----- width="480" height="350"><param name="movie"
value="http://www.youtube.com/v/OORDOd6wRrE&hl=en_US&fs=1"></param><param
name="allowFullScreen" value="true"></param><param
name="allowscriptaccess" value="always"></param><----
src="http://www.youtube.com/v/OORDOd6wRrE&hl=en_US&fs=1"
type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="480" height="350"><---><----->
string str=txt_Links.Text;
string lastNo = "";
bool firstNoFound = false;
for (int strIdx = 0; strIdx <= str.Length - 1; strIdx++)
{
if (IsInt(str.Substring(strIdx, 1)) == true)
{
lastNo = lastNo + str.Substring(strIdx, 1);
firstNoFound = true;
}
else
{
if (firstNoFound == true)
{
//Page.Title = lastNo;
str = str.Replace("width=\"" + lastNo + "\"", "width=\"250\"").Replace("height=\"" + lastNo + "\"", "height=\"250\"");
lastNo = "";
firstNoFound = false;
}
}
}
Response.Write(str);
这是修改后的链接。嗯,我的问题是,我想改变视频的大小,这意味着在整个字符串中,我想用width=“480”替换width=“250”,用height=“350”替换height=“250”
我想使用ASP.Net以编程方式更改这些参数
谢谢有什么问题吗 这对我很有用:
<object height="250" width="250">
<param name="movie" value="http://www.youtube.com/v/OORDOd6wRrE">
<param name="allowfullscreen" value="true">
<param name="wmode" value="opaque">
<embed src="http://www.youtube.com/v/OORDOd6wRrE" type="application/x-shockwave-flash" allowfullscreen="true" wmode="opaque" height="250" width="250">
</object>
另外,请查看以下教程:。我找到了解决方案
定义一个用户定义函数私有布尔IsInt(字符串IntValue)
{
试试看
{
int iValue=int.Parse(IntValue);
}
catch(异常Ex){return false;}
返回true;
}
<----- width="480" height="350"><param name="movie"
value="http://www.youtube.com/v/OORDOd6wRrE&hl=en_US&fs=1"></param><param
name="allowFullScreen" value="true"></param><param
name="allowscriptaccess" value="always"></param><----
src="http://www.youtube.com/v/OORDOd6wRrE&hl=en_US&fs=1"
type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="480" height="350"><---><----->
string str=txt_Links.Text;
string lastNo = "";
bool firstNoFound = false;
for (int strIdx = 0; strIdx <= str.Length - 1; strIdx++)
{
if (IsInt(str.Substring(strIdx, 1)) == true)
{
lastNo = lastNo + str.Substring(strIdx, 1);
firstNoFound = true;
}
else
{
if (firstNoFound == true)
{
//Page.Title = lastNo;
str = str.Replace("width=\"" + lastNo + "\"", "width=\"250\"").Replace("height=\"" + lastNo + "\"", "height=\"250\"");
lastNo = "";
firstNoFound = false;
}
}
}
Response.Write(str);
string str=txt\u Links.Text;
字符串lastNo=“”;
bool firstNoFound=false;
对于(int strIdx=0;strIdx),感谢您的快速回复。我知道,我想通过在ASP.Net中编程来更改这些参数。感谢您没有将问题的根源弄清楚。但是,它非常简单:myLabel.Text=“”
这绝对是而不是的方法!在我更新的答案中使用正则表达式
。非常感谢。我会尝试你的解决方案。那一次,我的问题用这段代码解决了。因此,这可能是一种错误的方法,但“它100%工作”。再次感谢你。