0
我的项目有问题。 我有一个js function sig7
它生成我的散列。执行的字符集
但html
页面的字符集要求为utf-8
。
我尝试在我C#
应用程序与库执行此js
一切都是美好的,但产生的哈希无效。我认为这是因为代码字符集不是utf-8
。
我的应用程序:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Noesis.Javascript;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
StreamReader sr = new StreamReader("c://lib.js");
string script = sr.ReadToEnd();
JavascriptContext context = new JavascriptContext();
context.Run(script);
var sig = context.Run(@"sig7('057d194dd856d4f8cd15bc85fbbddbf136df809f72f5a435e6af41c1f82f950f,Id166084073,ldsclldscl');").ToString();
richTextBox1.Text = sig;
}
}
}
SIG必须1dbde1d62b6e0dca7d56f72e50c178132e236978d2dba1e2c3ada5b7b8973aeb
但不7211ed8fe85d750c26cb5abb499bfa88b7cecbe968fc6cc7efa69dc496c8ae12
这是由我的应用程序产生的。
任何帮助?
Omg,man love u = * – user1993743
@ user1993743爱你也:)欢迎来到SO。 –