BC DotNet file/directory functions - access denied

hubi777hubi777 Member Posts: 8
Hello,

i am using BC OnPrem 18 (Cronus database) for testing.
At this time, i want to translate some file/directory code from NAV2013 to BC180 and got "access denied" errors.

C/AL: I can search all directories with dotnet „mscorelib“ functions without any problems.
AL: I can only search local but no external directories.

I think the problem seems to be the service user who searches the directories.
Can i change the behavior that BC uses the windows user for file actions?

dotnet
{
assembly(mscorlib)
{
type("System.Object"; Object) { }
type("System.IO.Directory"; IODirectory) { }
}
}

codeunit 50200 SearchData
{
:
var
FD_Object: DotNet Object;
FD_Dir: DotNet IODirectory;
NavDir: Text;

begin
NavDir := '\\fserver\data\';
FD_Object := FD_Verzeichnis.GetFiles(NavDir, '*.pdf');
:
end;
}

Thanks

Answers

Sign In or Register to comment.