我有一个ASP.NET站点,需要使用我们开发的COM接口.当我在visual studio环境中测试网站时,它工作正常.但是,当我将站点部署到IIS时,我收到一条错误说明
Retrieving the COM class factory for component with CLSID {0716BE95-6372-46B2-B42D-9FC0ED5E0FE3} failed due to the following error: 80040154 Class not registered
我尝试了一些事情
Any CPU,以x86作为建议这个答案.这导致另一个问题.Could not load file or assembly 'TestWebSimpleMath' or one of its dependencies. An attempt was made to load a program with an incorrect format.我认为这是一个倒退.我正在运行Windows 7旗舰版64位.
任何帮助都会很棒.我一直试图让这个工作近9个小时没有运气.
我正在尝试使用使用OAuth 1.0a的第三方服务,并且需要使用HMAC-SHA1进行签名.我在C#中编写了一个工作版本,并尝试将其移至Delphi XE2.我立刻发现了一些错误,服务器拒绝我的电话说我的"签名无效".这是我生成签名的方法:
function TOAuth1.GenerateSignature(signatureBase, key : string) : string;
var
hmacSha1 : TIdHMACSHA1;
keyBytes, textBytes, hashedBytes : TBytes;
begin
if(AnsiCompareText(fSignMethod,'PLAINTEXT') = 0) then
begin
Result := key;
end
else if(AnsiCompareText(fSignMethod,'HMAC-SHA1') = 0) then
begin
hmacSha1 := TIdHMACSHA1.Create;
SetLength(keyBytes,Length(key));
Move(key[1],keyBytes[0],Length(key));
hmacSha1.Key := keyBytes;
SetLength(textBytes,Length(signatureBase));
Move(signatureBase[1],textBytes[0],Length(signatureBase));
hashedBytes := hmacSha1.HashValue(textBytes);
Result := EncodeBase64(hashedBytes,Length(hashedBytes));
keyBytes := nil;
textBytes := nil;
hashedBytes := nil;
hmacSha1.Free;
hmacSha1 := nil;
end;
end;
Run Code Online (Sandbox Code Playgroud)
我不能发现任何疑似错误的我,所以我抓住一个signatureBase,并key从我的C#测试
signatureBase: POST&https%3A%2F%2Fapi.twitter.com%2Foauth%2Frequest_token&oauth_callback%3Dhttp%253A%252F%252Flocalhost%252Fsign-in-with-twitter%252F%26oauth_consumer_key%3DcChZNFj6T5R0TigYB9yd1w%26oauth_nonce%3Dea9ec8429b68d6b77cd5600adbbb0456%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1318467427%26oauth_version%3D1.0
键: L8qq9PZyRg6ieKGEKhZolGC0vJWLw8iEJ88DRdyOg&
在C#中使用这些值,我获得了签名F1Li3tvehgcraF8DMJ7OyxO4w9Y=,这是Twitter给我的预期价值.然而,在Delphi中,我获得了签名/kov410nJhE6PTlk0R8bjP7JQq4=
在Delphi中,我调用了我的函数: …
我有一个EditText,我希望用户能够输入MAC地址.
如何限制用户只输入A,B,C..F和数字并以正确的格式写出(00:11:22:33:44:55)?
我该如何验证?
编辑:我发现这个代码可以满足我的需求,但需要使用IP地址.我试图使用你建议的正则表达式,但它们不起作用.
public void showIP(){
// Set an EditText view to get user input
final EditText input = new EditText(this);
input.setInputType(InputType.TYPE_CLASS_PHONE);
input.setSingleLine();
InputFilter[] filters = new InputFilter[1];
//filter used to allow only IPv4 style address
filters[0] = new InputFilter() {
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
if (end > start) {
String destTxt = dest.toString();
String resultingTxt = destTxt.substring(0, dstart) + source.subSequence(start, end) + destTxt.substring(dend);
if (!resultingTxt.matches("^[\\dA-F]{2}(?::[\\dA-F]{2}){5}$")) {
return …Run Code Online (Sandbox Code Playgroud) 我正在尝试base64编码一个图像以便在iOS上传,但是愚蠢的东西没有内置的支持,所以我下载了两个库并尝试了它们,但我认为它们返回了错误的值(除非我理解base64甚至比我想的还要少. 这个网站返回一个以这个开头的长字符串: /9j/4Q+zRXhpZgAASUkqAAgAAAAKAA4BAgAgAAAAhgAAAA8BAgAFAAAApgAAABABAgAKAA
当我使用我下载的库进行加密时,它从这开始:iVBORw0KGgoAAAANSUhEUgAAAI0AAABnCAIAAACy41YWAABAAElEQVR4AbzdeaylyXUY9nf3
我100%确定第一个是正确的,因为当我使用编写的测试程序来测试服务器时,这是它上传到服务器的相同代码,服务器愉快地解码文件并保存图像.这是测试图像.
基本上,我在想的是我需要为iPhone/iPad建立一个不同的库.我注意到的另一个奇怪的事情是,对于某些图像,=将位于字符串的末尾,而对于其他图像则不会.我可以为此考虑三个原因.
1)iPhone内存不足,不想告诉我它只是上传了它的内容.
2)图书馆坏了
3)我很困惑,也不懂base64
有什么建议?
编辑:iPhone实际上是模拟器,所以我不知道它是否会在计算机之前耗尽内存.我知道android模拟器没有,但我不确定iOS模拟器.
我有一个应用程序,我只希望我公司的员工使用.它将在Apple和Android App商店中提供.我试图找到一种方法来保护它,以便只有员工才能登录它.
目前,它设置为在注册时接受公司电子邮件,并发送包含激活链接的电子邮件.我觉得应该有一个更好的方法来做这个不涉及使用电子邮件.
有没有人有什么建议?
编辑:
此外,这个应用程序目前是公司的原型,所以我无法访问员工ID,如现在.