如何在Vb.Net中读取.Cer文件 [英] How to Read .Cer file in Vb.Net

查看:131
本文介绍了如何在Vb.Net中读取.Cer文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在vb.net中逐行读取加密的.Cer文件?我想从该文件中获取一些数据.
我也可以解密文件,但是我不知道如何从解密文件中获取数据.
请帮助我.
紧急.

谢谢,
Jogu

How to Read Encrypted .Cer file line by line in vb.net? I want to get some data from that file.
I can also decrypt file but I dont know how to get the data from Decrypted file.
Pls help me.
Urgent.

Thanks,
Jogu

推荐答案

[ ^ ]并非最佳示例,但可能会有所帮助.

您实际上不能读取"此文件,而只能将其用作"安全密钥.
This[^] is not the best sample in terms of what you ask, but it may help.

You cannot actually "read" this file, but rather "use" it as the security key.


我对.Cer文件了解不多,但可以您只是使用System.IO库阅读它吗?

这是一个示例:

/*-[使用指令] ------------------------------------------ ------- */
使用System.IO

I don''t know much about the .Cer file but can''t you just read it using System.IO library?

Here is a sample:

/*--[using directives]-------------------------------------------------*/
using System.IO

/*--[ Function ]---------------------------------------*/
/*
  Name            : ReadTxtFile_ToLst
  Description     : Reads data line- for line from a text file and stores
                    it to a list buffer.

  Access Modifier : public
  Param           : string txtFilePath

  Retval          : List<string>
*/
/*-----------------------------------------------------*/
public List<string> ReadTxtFile_ToLst(string txtFilePath)
{
  List<string> returnValue = new List<string>();
  FileInfo genericFileInfo = new FileInfo(txtFilePath);
  StreamReader sr = genericFileInfo.OpenText();
  string lineContents;

  while (sr.EndOfStream != true)
  {
    lineContents = sr.ReadLine();
    returnValue.Add(lineContents);
  }
  return returnValue;
}



希望这就是您想要的!

鲁道夫(Rudolf,:)



Hope this is what you were looking for!

Rudolf, :)


这篇关于如何在Vb.Net中读取.Cer文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆