我的项目结构如下:
Read.aspx采用一个参数说"输出",这是由id及其注释传递的文章的细节 ArticlesController.cs
现在我想写,然后阅读评论:: write()&Read()funct inCommentsController.cs
对于读其评论文章中,我想打电话Views/Articles/Read.aspx从CommentsController.cs通过从通过输出参数CommentsController.cs
我怎样才能做到这一点?
代码在这里:
public class CommentsController : AppController
{
public ActionResult write()
{
//some code
commentRepository.Add(comment);
commentRepository.Save();
//works fine till here, Data saved in db
return RedirectToAction("Read", new { article = comment.article_id });
}
public ActionResult Read(int article)
{
ArticleRepository ar = new ArticleRepository();
var output = ar.Find(article);
//Now I want to redirect to Articles/Read.aspx with output parameter. …Run Code Online (Sandbox Code Playgroud) 根据我使用HMAC SHA256阅读的各种文档,我已经理解:
H(K XOR opad,H(K XOR ipad,text))其中H在我的情况下是SHA256.
但是,SHA256输入只有一个参数,即消息.而H(K,text)有两个输入.那么如何计算H(k,文本)?
我应首先使用k对文本进行编码,然后使用H(encoded_text),其中encoded_text将用作消息?
谢谢