麻烦大虾们帮个小忙 20
因为我想把电影的字幕文件中的英语台词过滤出来就编了一个网页程序是用ASP.NET写的语法上没有问题可始终得不出结果请大家帮忙看下为什么处理的字幕文件像这样的:100:00...
因为我想把电影的字幕文件中的英语台词过滤出来 就编了一个网页程序 是用ASP.NET写的 语法上没有问题 可始终得不出结果 请大家帮忙看下为什么
处理的字幕文件像这样的:
1
00:00:04,840 --> 00:00:06,307
Warden wants to talk.
2
00:00:20,055 --> 00:00:21,113
Out here?
3
00:00:21,323 --> 00:00:23,553
That's what the man said.
4
00:00:39,674 --> 00:00:40,663
Warden?
我编写的程序是这样的:
<html>
<head>
<title>字幕变成我喜欢的</title>
<script language="vb" runat="server">
sub button_click(obj as object,e as eventargs)
dim suoyin as integer,changdu as integer
dim regexp1 as regex =new regex("\d+\r\d{2}\W\d{2}\W\d{2}\W\d{3}\W{5}\d{2}\W\d{2}\W\d{2}\W\d{3}\r")
dim abc as match
dim stra as string,strb as string
show.innerhtml=""
for each abc in regexp1.matches(zimu.text)
stra=abc.tostring
suoyin=zimu.text.indexof(stra)
changdu=stra.length
strb=zimu.text.remove(suoyin,changdu)
next
zimu.text=""
show.innerhtml=strb
end sub
</script>
</head>
<body>
<form runat="server">
输入要转换的字幕:<p>
<asp:textbox id="zimu" textmode="multiline" rows="10" columns="60" runat="server" />
<p>
<asp:button id="queding" text="确定" onclick="button_click" runat="server" />
<p>
</form>
<span id="show" runat="server"></span>
</body>
</html> 展开
处理的字幕文件像这样的:
1
00:00:04,840 --> 00:00:06,307
Warden wants to talk.
2
00:00:20,055 --> 00:00:21,113
Out here?
3
00:00:21,323 --> 00:00:23,553
That's what the man said.
4
00:00:39,674 --> 00:00:40,663
Warden?
我编写的程序是这样的:
<html>
<head>
<title>字幕变成我喜欢的</title>
<script language="vb" runat="server">
sub button_click(obj as object,e as eventargs)
dim suoyin as integer,changdu as integer
dim regexp1 as regex =new regex("\d+\r\d{2}\W\d{2}\W\d{2}\W\d{3}\W{5}\d{2}\W\d{2}\W\d{2}\W\d{3}\r")
dim abc as match
dim stra as string,strb as string
show.innerhtml=""
for each abc in regexp1.matches(zimu.text)
stra=abc.tostring
suoyin=zimu.text.indexof(stra)
changdu=stra.length
strb=zimu.text.remove(suoyin,changdu)
next
zimu.text=""
show.innerhtml=strb
end sub
</script>
</head>
<body>
<form runat="server">
输入要转换的字幕:<p>
<asp:textbox id="zimu" textmode="multiline" rows="10" columns="60" runat="server" />
<p>
<asp:button id="queding" text="确定" onclick="button_click" runat="server" />
<p>
</form>
<span id="show" runat="server"></span>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询