使用xml数据源实现一些安全性 [英] Implementing some security with xml datasource

查看:44
本文介绍了使用xml数据源实现一些安全性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序当前将其强类型数据集(数据集是以编程方式而非向导方式)写入xml文件(使用mydataset.WriteXml("mypathhere.xml",XmlWriteMode.WriteSchema))。然后我使用该xml文件作为我的水晶报告的数据源。我不想使用内存中的数据集来制作水晶报告,因为我不希望每次运行都生成报告。在有人运行程序之后我有一个单独的按钮来查看报告,因为我是新手,我不知道如何直接从数据集中执行此操作。


<但是,我担心会篡改数据。我已将其设置为在程序至少运行一次之前无法生成报告,从而确保已创建新文件。我不认为这会阻止某人运行程序,打开xml文件并手动修改并关闭它,然后单击视图报告按钮。


有没有办法在写入xml文件之前加密数据,并在读取文件后让水晶报告解密?或者也许是另一种防止某人篡改数据的方法?


或者我可以将数据写入访问数据库使用数据库密码,但我一直运气不佳获取帮助制作水晶报告与之合作。即使我在制作数据源时告诉它使用正确的密码,它仍然会在生成报告时提示登录。



解决方案

报告将在运行时提示输入密码,除非您在运行时将密码传递给报告。报告不会通过连接保存密码。


My application currently writes it's strongly typed dataset (the dataset was made programmatically rather than with the wizard) to an xml file (using mydataset.WriteXml("mypathhere.xml",XmlWriteMode.WriteSchema)).  I then use that xml file as a datasource for my crystal reports.  I didn't want to use a dataset from memory to make the crystal reports because I don't want the report to be generated each run.  I have a seperate button to view the report if desired after someone runs the program and, since I'm new to this, I wouldn't know how to just do this directly from the dataset.

I'm worried about tampering with data, though.  I have it set up so that the report can't be generated until the program has been run at least once, ensuring that a new file has been created.  I don't think this would stop someone from running the program, opening the xml file and modifying it by hand and closing it, then clicking the view report button. 

Is there a way to encrypt the data before writing to the xml file and have crystal reports decrypt it after reading the file?  Or perhaps another way to prevent someone from tampering the data?

Alternatively I could write my data to an access database use a database password but I have been having extremely bad luck getting help making crystal reports work with that.  Even though I tell it to use the correct password when making the datasource, it still prompts for login when generating the report.

 

 

解决方案

The report will prompt for a password at runtime unless you pass the password at runtime to the report.  The report does not save the password with the connection.


这篇关于使用xml数据源实现一些安全性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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