加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 如何在Dotnetnuke中更改Radcaptcha的音频文件

发布时间:2020-12-16 09:36:40 所属栏目:asp.Net 来源:网络整理
导读:我在DNN网站上使用反馈6.0.0,它使用RadCaptcha和音频代码. 当我在localhost中使用它时,它工作正常,我可以用默认音频文件替换另一个.wav文件.但是当我在服务器上安装此模块时,模块从WebResource读取音频文件而不是从我设置的地址读取音频文件我无法替换此音频
我在DNN网站上使用反馈6.0.0,它使用RadCaptcha和音频代码.
当我在localhost中使用它时,它工作正常,我可以用默认音频文件替换另一个.wav文件.但是当我在服务器上安装此模块时,模块从WebResource读取音频文件而不是从我设置的地址读取音频文件我无法替换此音频文件.

即使我从RadCaptcha文件夹中删除此音频文件,该模块也会从webResource中读取音频文件.

我使用此代码来使用RadCaptcha:

<dnn:dnnCaptcha ID="ctlCaptcha" runat="server" EnableRefreshImage="True" Width="300px" CaptchaImage-AudioFilesPath="~/DesktopModules/Feedback/App_Data/RadCaptcha" />

我的问题是如何在服务器中的RadCapcha中替换我的自定义音频文件,而不是在localhost中

解决方法

Atabrizi,您是否在web.config文件中正确配置了处理程序?

<httphandlers>
    <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" /> 
</httphandlers>
<handlers>
    <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" /> 
</handlers>

另外,我在他们的文档中发现了以下信息:

In order for the Captcha to be able to output an audio file the web
application must be run in a full trust environment. Basically the
application should run as a user account that has permissions to call
the SpeechSynthesizer.Speak(textToSpeak) method on the server. Usually
the user account does not have the needed permissions and the
administrator has to grant them. For example in IIS 6+ the Application
Pools run as the ApplicationPoolIdentity built-in account (this is by
default) which does not have enough permissions to call
SpeechSynthesizer.Speak(textToSpeak). To be able to generate the code
the Application Pools should have permissions as the LocalSystem
built-in account.

但是也有一个替代方案:

In case the web application does not have enough permissions to
“Speak” the text code or it uses .NET2.x (earlier than 3.0 versions of
.NET Framework),the audio file will be generated by concatenation of
“.wav” files that correspond to the specific character from the text
code. By default RadCaptcha will look for the files in the
App_DataRadCaptcha directory,so you need to supply the folder and
the files. You can copy the App_DataRadCaptcha directory located in
the App_Data folder of your RadControls for ASP.NET AJAX installation.
Please note that in order for the audio code to be generated
correctly,there must be a “.wav” file for every possible character
that can appear on the image and the file must be named as the
character itself – “[Char]”.wav (i.e. A.wav,B.wav,C.wav,1.wav,
2.wav etc.).

http://www.telerik.com/help/aspnet-ajax/captcha_audio.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读