I'm trying to make a little utility to generate encrypted passwords for MSD files (change the XML inside the zip). I found this example online, but I'm not familiar with esri's API, so I'm not sure how to use
IWorkspaceName2::ConnectionString as suggested in the following documentation link -
OpenFromString actually makes a connection, which is not ideal for my purposes, so if that can be ommited entirely and get the
ConnectionString property value from the
IWorkspaceName2 that would do it. I wasn't able to find out how to create a
IWorkspaceName2 object so that's what I'm looking for, either c# or vb.net.
string connectionString = "SERVER=myServer;DATABASE=sde;INSTANCE=5151;USER=Editor;PASSWORD=Editor;VERSION=SDE.DEFAULT" IWorkspaceFactory2 workspaceFactory = (IWorkspaceFactory2)new ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactoryClass(); return workspaceFactory.OpenFromString(connectionString, 0); //A better solution is to use IWorkspaceName2::ConnectionString which returns an encrypted password: ENCRYPTED_PASSWORD=0001d2756fc3e1b91529;SERVER=myServer;INSTANCE=5151;USER=Editor;VERSION=SDE.DEFAULT`