前提:即将开展的项目的要求包括除了授权用户之外没有人可以访问某些数据.这通常很好,但这种情况并不常见.这些要求规定,即使程序员或任何其他IT员工也无法访问此信息.(他们希望我存储它而不能看到它.)
在我提出的所有场景中,我总能找到一种访问数据的方法.让我来介绍其中一些.
方案I:限制实时数据库上的表,以便只有SQL管理员可以直接访问它.
黑客1:我推出了一项更改,将数据发送到另一个表以供日后查看.此外,SQL管理员可以查看数据,这打破了要求.
方案II:加密数据,以便需要密码才能解密.该密码仅供用户知道.每次创建新记录时以及每次检索旧记录中的数据时都需要它.加密/解密将在JavaScript中发生,因此密码永远不会被发送到服务器,在那里它可以被记录或嗅探.
Hack II:推出一个更改,记录javascript中的按键并将它们发回服务器,以便我可以检索密码.或者,推出一个简单地将未加密数据存储在隐藏字段中的更改,该字段可以发布到服务器以供以后查看.
场景III:与场景II相同,除了加密/解密发生在我们无法控制的网站上.这个神奇的网站将允许用户输入密码和加密或纯文本数据,然后使用javascript来解密或加密该数据.然后,用户可以只复制加密文本并将其放入字段中以获取新记录.他们还必须使用此站点查看旧记录的纯文本.
Hack III:除了在他们的系统上安装一个完整的密钥记录器,我不知道如何打破这个.
因此,场景III看起来很有前途,但对用户来说这很麻烦.还有其他可能性我可以忽略吗?
我在调用页面时调用了以下javascript来请求焦点.
使用Firefox和IE7,此代码100%正常,但Chrome和Safari似乎根本没有移动焦点.如何使它适用于所有浏览器?
document.getElementById("MyFlashFile").focus();
Run Code Online (Sandbox Code Playgroud) 我必须对网站进行编程,但我宁愿不喜欢静态HTML性质.我更喜欢客户端 - 服务器架构.
现在我已经想到,使用XMLhttp,您基本上可以动态更新页面并向/从服务器发送/请求信息/操作.所以这基本上涵盖了客户区域.
但是,要完成客户端 - 服务器体系结构,服务器也必须发送/请求信息,而不进行查询.
有没有办法,例如对于聊天服务器,将收到的消息发送回所有客户端(客户端使用Web浏览器),而客户端不必在固定的时间间隔内查询?我想实现一个人在你输入内容时可以看到的内容.
我在我的代码中创建了一个基本的EasterEgg,以便在使用以下代码进行以下击键时(不同时)激活Enter + c + o + l + o + r + s:
isEnter = 0; isC = 0; isO = 0; isL = 0; isR = 0; isS = 0;
$(window).keydown(function(e){
if(e.which==13) isEnter = 1; if(e.which==67) isC = 1; if(e.which==79) isO = 1;
if(e.which==76) isL = 1; if(e.which==82) isR = 1; if(e.which==83) isS = 1;
ColorMap();
});
function ColorMap(){
if(isEnter==1 && isC==1 && isO==1 && isL==1 && isR==1 && isS==1){
//DO FUNCTION//
isEnter = 0; isC = …Run Code Online (Sandbox Code Playgroud) 我有对第三方API的服务引用.我使用自定义ChannelFactory类来为此API构建通道(System.ServiceModel.ClientBase类型的[WCF]).
我有一个自定义行为类(在下面定义),我附加到此通道端点,以处理从API返回的任何异常.在我的普通.NET代码中,这很好用.但是,在Silverlight中,只有在没有错误的情况下才会调用AfterReceiveReply方法.
在这种情况下,当您尝试引用eventArgs的结果时,调用方法会遇到错误:'eventArgs.Result' threw an exception of type 'System.Reflection.TargetInvocationException'.
内部异常有: InnerException = {System.ServiceModel.CommunicationException: The remote server returned an error: NotFound.
无论REAL错误如何,我都会看到上述错误.在Fiddler,我可以看到真正的错误.隐藏它的频道处理只是一些东西.下面是具有实际错误的SOAP响应的示例.(删除了一些值.)
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode><!-- REMOVED REAL CODE --></faultcode>
<faultstring><!-- REMOVED REAL FAULT --></faultstring>
<detail>
<!-- REMOVED DETAILS -->
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Run Code Online (Sandbox Code Playgroud)
我确信我还没有提供足够的相关信息,但我不知道所有相关内容.在评论中询问更多信息.
我该如何调试呢?相同的代码适用于.NET,但Silverlight无法很好地处理它.
一些相关的代码如下.
行为:
public class ExceptionMapperBehavior : IClientMessageInspector, IEndpointBehavior
{
public void AfterReceiveReply(ref Message reply, object correlationState)
{
//this is only called if there is no fault--not helpful! …Run Code Online (Sandbox Code Playgroud) 当用户单击"注销"按钮时,我的服务器控制台中出现以下错误.
Error: socket hang up
at createHangUpError (http.js:1472:15)
at Socket.socketCloseListener (http.js:1522:23)
at Socket.EventEmitter.emit (events.js:95:17)
at TCP.close (net.js:466:12)
Run Code Online (Sandbox Code Playgroud)
这是我的proxy_server:
var fs=require('fs');
var options = {
key: fs.readFileSync('key/xxxxxxxxx.pem'),
cert: fs.readFileSync('key/xxxxx.pem'),
ca: fs.readFileSync('key/gd_bundle-g2-g1.crt')
};
var express=require('express'),
https=require('https'),
httpProxy = require('http-proxy'),
http=require('http'),
app=express(),
app1=express(),
server=https.createServer(options,app),
serverhttp=http.createServer(app1);
var proxy = httpProxy.createProxy({ target: 'http://localhost:9898',secureOptions:'constants.SSL_OP_NO_TLSv1_2'});
var proxySig = httpProxy.createProxy({target:'http://localhost:8881',secureOptions:'constants.SSL_OP_NO_TLSv1_2'});
var callSig = httpProxy.createProxy({target:'http://localhost:6666',secureOptions:'constants.SSL_OP_NO_TLSv1_2'});
var proxyCdn = httpProxy.createProxy({target:'http://localhost:3030',secureOptions:'constants.SSL_OP_NO_TLSv1_2'});
// var proxyhttps= new httpProxy.createProxy({ target: 'https://localhost:443',secure:false});
var errorhandler = require('errorhandler');
app.all('*', function(req,res){
if(req.hostname=='xxxxxxxx.in')
{
proxy.web(req, res);
}
else if(req.hostname=='xxxx.in') …Run Code Online (Sandbox Code Playgroud) 我有一种情况,我想在一个日期添加小时,并在工作日周围换新日期.我拼凑了一个函数来确定这个新日期,但我想确保我没有忘记任何事情.
要添加的小时称为"延迟".它很容易成为函数的参数.
请发布任何建议.[VB.NET警告]
Private Function GetDateRequired() As Date
''// A decimal representation of the current hour
Dim hours As Decimal = Decimal.Parse(Date.Now.Hour) + (Decimal.Parse(Date.Now.Minute) / 60.0)
Dim delay As Decimal = 3.0 ''// delay in hours
Dim endOfDay As Decimal = 12.0 + 5.0 ''// end of day, in hours
Dim startOfDay As Decimal = 8.0 ''// start of day, in hours
Dim newHour As Integer
Dim newMinute As Integer
Dim dateRequired As Date = Now
Dim delta As Decimal …Run Code Online (Sandbox Code Playgroud) 我试图做类似功能的自动滚动/旋转木马的图片的无序列表.
当你将鼠标悬停在包含的div上时,它调用一个函数,该函数的作用是为其上的边距设置动画 <ul>
$(".thumbs").animate({"margin-top": (currentMargin - 10) + "px"}, function(){
console.log("margin-top" + (currentMargin - 10) + "px");
running=false;
});
Run Code Online (Sandbox Code Playgroud)
我在日志中看到了我想要的正确值,即动画认为它已经完成......但是我的div没有任何改变.
没有人有任何的洞察力至于什么可能使动画功能无法正常工作打算?
谢谢
用户将在textarea中输入文本.然后将其直接插入mySQL数据库.我在它上面使用trim,htmlentities,mysql_real_escape_string,并启用了魔术引号.将数据输出回textarea时,我应该如何清理它?
谢谢你的帮助.我从来没有太确定这样做的正确方法......
你如何选择一个div是当前$(this)的孩子?
我有很多带有类行的div,每个div都有一个名为form_explanation的隐藏div.我想在行onClick-ed时show()显示div form_explanation.
谢谢!
javascript ×4
jquery ×3
.net ×1
ajax ×1
animation ×1
asp.net-mvc ×1
database ×1
date ×1
effects ×1
encryption ×1
express ×1
flash ×1
forms ×1
html ×1
http-proxy ×1
json ×1
keystroke ×1
mysql ×1
node.js ×1
php ×1
reset ×1
safari ×1
sanitization ×1
security ×1
silverlight ×1
socket.io ×1
variables ×1
vb.net ×1
wcf ×1