Hello everyone
I am starting to work with the Laserfiche SDK and I am presented with the following situation in which I want to be guided.
I have the following folder structure:
For example, the file "Alvaro", I need to move it inside the folder "C" and in turn rename it with a new name (Charlie).
The code that I have is the following:
private void btnMover_Click(object sender, EventArgs e) { string nombreViejo = cmbListaExpedientes.Text; string nombreNuevo = txtNuevoNombre.Text; char primeraLetra = nombreNuevo[0]; int id = 0; RepositoryRegistration ra = new RepositoryRegistration("localhost", "??????"); Session mySess = new Session(); try { mySess.LogIn("?????", "??????", ra); Search LFSearch = new Search(mySess); LFSearch.Command = "{[General]} & {LF:Name=\""+nombreViejo+"\", Type=\"F\"}"; LFSearch.Run(); SearchListingSettings Settings = new SearchListingSettings(); SearchResultListing Results = LFSearch.GetResultListing(Settings); for (int i = 1; i <= Results.RowsCount; i++) { id = Convert.ToInt32(Results.GetDatumAsString(i, SystemColumn.Id)); FolderInfo folder = Folder.GetFolderInfo(id, mySess); string ruta = "\\Regulados\\" + primeraLetra+ "\\" + nombreNuevo; folder.MoveTo(ruta); } } catch(Exception ex) { MessageBox.Show(ex.ToString()); } finally { mySess.Close(); } }
For the previous example it works correctly, the error that occurs to me is if I try to move the file "Alvaro" to a folder like "F", "G", "H"; a folder that does not exist.
Shows the error "Entry not found".
Can you help me?