Hi,

I have a file in the project which is called as it is.

var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("WindowsFormsApplication2.ds.cdx");

         var bytes = new byte[stream.Length];
         var read = stream.Read(bytes, 0, (int) stream.Length);
         var molecule = MolImporter.importMol(bytes);

How can I give the path of the file.

I have given the path like this

var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(@"C:\\Users\\Srikanth\\Desktop\\ds.cdx");

It gives me an error.
Is there any other way to do it as I want to load file from any location.

Thanks,
Sri

Recommended Answers

All 2 Replies

I'm not sure why you're using GetManifestResourceStream, this is for loading a manifest resource from your application. Why are you trying to load a CDX file?

I want to load cdx file as my project demands. Is there a way to get the file by using path?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.