我对silverlight相当新,我觉得很酷.我有一个关于它如何运行代码客户端的问题..
比如说,我有一个网站根据用户输入的金额计算一定数量.这当然我喜欢做客户端.但问题是,用于计算的公式是专有的并且是商业秘密.如果我使用SL将此公式放在客户端,它会安全吗?还是可以反映出来?
我使用Visual Studio 2008 Professional自动化测试.我有一个写入文件的函数.我想单元测试文件写入功能.我已经读过某个地方,我不得不以某种方式模拟文件.我不知道怎么做.你能帮我吗?
如何对从Internet下载页面的方法进行单元测试?
automated-tests unit-testing mocking visual-studio-2008 visual-studio
有谁知道在哪里可以找到ASP.NET MVC Framework Beta中使用的AJAX的在线文档?我似乎找不到它.我一直在寻找快速入门的一些信息和谷歌搜索,但似乎很难找到.
它现在似乎有点受限.人们是否使用它或与其他AJAX框架(如script.aculo.us)结合使用?
我对C#和.NET很陌生,而且我对数据绑定的整个概念有些不满.我要求的是对概念的快速概述,或者甚至更好,指向网上(首选)或印刷品中的来源,这可以帮助我理解这个想法.
编辑:
我在vs2008中进行了开发,我们正在使用winforms
我有一个我在几年前在WinForms中写过的副项目.为了更好地帮助我学习WPF,我想在WPF中重写它.理想情况下,我想修改我当前的项目并在WPF中重写UI而不是创建新项目.
我在做这件事时遇到了一些问题.我做了以下(使用Visual Studio 2008 SP1):
在这一点上,我注意到有些不对劲.当我右键单击该项目并选择Add | New Item,我没有创建WPF窗口的选项 - 我可以创建的唯一WPF类是WPF用户控件.由于我有一些其他WPF项目,我将App.xaml.*和Window1.xaml.*从该项目复制到我的,并根据需要更新它们(基本上只是将该项目的命名空间更改为我项目的命名空间).
然后我删除了Program.cs(之前包含Main方法,显示了主WinForm表单),并构建了该项目.我收到一个错误,表明没有Main方法.
看起来内部Visual Studio知道这个项目实际上是一个WinForms应用程序,而不是WPF应用程序.在WPF项目中(通过选择"WPF Application"创建),在Application属性中,我可以将Application类的实例设置为启动对象.在我的WinForms转换项目中,这不是一个选项.
我在文本编辑器中快速查看了.csproj文件,但我找不到任何可以告诉Visual Studio项目实际上是WinForms而不是WPF的东西.
还有什么办法可以将我的WinForms项目变成一个"真正的"WPF项目?除了创建新项目并只替换当前项目之外,我还有其他选择吗?
更新:我仔细查看了.csproj文件,我注意到App.xaml已添加为页面:
<Page Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
Run Code Online (Sandbox Code Playgroud)
但是,在我的其他WPF项目中,它是一个ApplicationDefinition.一旦我改变了,我可以将我的Application实例设置为启动对象,我的应用程序将运行.但是,我仍然没有选项来创建除用户控件之外的任何WPF类型.
如何使用HttpWebRequest 登录此页面http://www.bhmobile.ba/portal/index?
登录按钮是"Pošalji"(左上角).
<table id="maintable" border="0" cellspacing="0" cellpadding="0" style="height:100%; width:100%">
<tr>
<td width="367" style="vertical-align:top;padding:3px"><script type="text/javascript">
function checkUserid(){
if (document && document.getElementById){
var f = document.getElementById('userid');
if (f){
if (f.value.length < 8){
alert('Korisni?ko ime treba biti u formatu 061/062 xxxxxx !');
return false;
}
}
}
return true;
}
</script>
<div style="margin-bottom:12px"><table class="leftbox" style="height:184px; background-image:url(/web/2007/slike/okvir.jpg);" cellspacing="0" cellpadding="0">
<tr>
<th style="vertical-align:middle"><form action="http://sso.bhmobile.ba/sso/login" method="post" onSubmit="return checkUserid();">
<input type="hidden" name="realm" value="sso">
<input type="hidden" name="application" value="portal">
<input type="hidden" name="url" value="http://www.bhmobile.ba/portal/redirect?type=ssologin&url=/portal/show?idc=1111">
<table class="formbox" …Run Code Online (Sandbox Code Playgroud) Perl的
print 2 % -18;
Run Code Online (Sandbox Code Playgroud)
- >
-16
Run Code Online (Sandbox Code Playgroud)
TCL
puts [expr {2 % -18}]
Run Code Online (Sandbox Code Playgroud)
- >
-16
Run Code Online (Sandbox Code Playgroud)
但是VBScript
wscript.echo 2 mod -18
Run Code Online (Sandbox Code Playgroud)
- >
2
Run Code Online (Sandbox Code Playgroud)
为什么不同?
我正在寻找一种方法来了解Java应用程序(没有 JNI - 它是一个多平台应用程序)可以检测屏幕是否被锁定.
有关信息...我们的应用程序在用户工作时记录时间 - 我们希望它在屏幕被锁定时自动停止记录,而不是用户必须明确地这样做.
我试图通过页面方法返回用户/服务器控件的html表示.当我调用带有虚拟路径到用户控件的重载时,它工作,但是当我尝试调用带有类型的重载时,它不起作用.示例代码如下.有什么建议?
[WebMethod]
public static string LoadAlternates(string productId, string pnlId)
{
object[] parameters = new object[] { pnlId, productId };
return ControlAsString(typeof(PopupControl), parameters);
}
private static string ControlAsString(Type controlType, object[] parameters)
{
Page page = new Page();
UserControl controlToLoad;
/*
*calling load control with the type results in the
*stringwriter returning an empty string
*/
controlToLoad = page.LoadControl(controlType, parameters) as UserControl;
/*
*However, calling LoadControl with the following overload
*gives the correct result, ie the string rep. of the control.
*/ …Run Code Online (Sandbox Code Playgroud) .net ×3
c# ×3
winforms ×2
ajax ×1
asp.net ×1
asp.net-ajax ×1
asp.net-mvc ×1
data-binding ×1
f# ×1
java ×1
keyword ×1
login ×1
mocking ×1
modulo ×1
obfuscation ×1
perl ×1
silverlight ×1
tcl ×1
unit-testing ×1
upgrade ×1
vbscript ×1
wpf ×1