Comments (4)
I guess never mind... this was meant for ModernKeypassLib
from modernkeepass.
Hi,
I work on both, so don't worry. I will create a Readme file on the ModernKeePassLib project explaining how to use it. I agree it's not as easy as it looks, because I tried to do minimal changes in the original code, so the workflow can be a bit twisted.
The thing is, you can't use a file path to create a IOConnectionInfo. Instead, IOConnectionInfo requires a byte array, like so:
var ioConnection = IOConnectionInfo.FromByteArray(byte_array);
Then you can open your database.
(I did this to remove the dependency on the file system.)
from modernkeepass.
Hi,
I updated the readme to give info on how to use the library.
Please let me know if this works for you.
Readme
from modernkeepass.
`var dbpath = @"c:\Database2.kdbx";
//var keypath = @"\xxx\Desktop\KeePassDatabase\Database.key";
var masterpw = "123456";
var ioConnInfo = IOConnectionInfo.FromByteArray(File.ReadAllBytes(dbpath));
var compKey = new CompositeKey();
compKey.AddUserKey(new KcpPassword(masterpw));
//compKey.AddUserKey(new KcpKeyFile(IOConnectionInfo.FromPath(keypath)));
var db = new PwDatabase();
db.Open(ioConnInfo, compKey, new NullStatusLogger());
//var kpdata = from entry in db.RootGroup.GetEntries(true)
// select new
// {
// Group = entry.ParentGroup.Name,
// Title = entry.Strings.ReadSafe("Title"),
// Username = entry.Strings.ReadSafe("UserName"),
// Password = entry.Strings.ReadSafe("Password"),
// };
//Console.WriteLine(string.Join(Environment.NewLine, kpdata));
db.Close();`
I used the above code, but why would it give me this error?
未经处理的异常: System.InvalidOperationException: 节点类型 Attribute 上不支持 ReadElementContentAsString 方法。 行 34,位置 19。
在 System.Xml.XmlReader.SetupReadElementContentAsXxx(String methodName)
在 System.Xml.XmlReader.ReadElementContentAsString()
在 ModernKeePassLib.Serialization.KdbxFile.ReadBase64(XmlReader xr, Boolean bRaw)
在 ModernKeePassLib.Serialization.KdbxFile.ReadProtectedBinary(XmlReader xr)
在 ModernKeePassLib.Serialization.KdbxFile.ReadXmlElement(KdbContext ctx, XmlReader xr)
在 ModernKeePassLib.Serialization.KdbxFile.ReadDocumentStreamed(XmlReader xr, Stream sParentStream)
在 ModernKeePassLib.Serialization.KdbxFile.ReadXmlStreamed(Stream sXml, Stream sParent)
在 ModernKeePassLib.Serialization.KdbxFile.Load(Stream sSource, KdbxFormat fmt, IStatusLogger slLogger)
在 ModernKeePassLib.PwDatabase.Open(IOConnectionInfo ioSource, CompositeKey pwKey, IStatusLogger slLogger)
在 ConsoleApp1.Program.Main(String[] args) 位置 C:\Users\ygct\source\repos\ConsoleApp1\ConsoleApp1\Program.cs:行号 28请按任意键继 续. . .
from modernkeepass.
Related Issues (14)
- Log in Not working HOT 3
- Make extension name register opt-in HOT 1
- Can we port cross platform keepassxc instead? HOT 2
- Is there any Windows Store alternative to download ModernKeePass? HOT 1
- I have found a problem with ModernKeePass ...
- 39 error when I building it
- Cannot save database without StorageFile HOT 4
- Windows Hello Support missing HOT 5
- After saving master password has changed HOT 2
- System.NullReferenceException HOT 3
- Unable to use ModernKeePassLib from net472 assembly HOT 1
- Log in not working HOT 2
- Allow select any type of file as key file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modernkeepass.