JunctionPoint deals with Directory. My need is file symlink, espec HardLink, which means that the link resides on the same volume as the target but in another Directory.
my Nick
Posts
-
Info File vs. Hardlink -
Info File vs. HardlinkHi. All i want to do is something like
...
foreach (string f in Directory.GetFiles(@"X:\someDir"))
{
Console.Write(f);
if (IsHardlink(f) == false) Console.WriteLine(" is real fileentry");
else Console.WriteLine(" is hardlink and the target is " + GetTargetName(f));
}
...
private bool IsHardLink(string filePath)
{
???
}
private string GetTargetName(string filePath)
{
???
}I 'googled' for days, found tons of articles 'how to create hardlinks, junctions' etc, also many examples for 'get the linkcount of a given file" (the target), but nothing for my need. Please help, give me advice, point me in a direction. Thank you
-
C++ DLL within C# applicationThank you very much, John. I will see and try ...
-
C++ DLL within C# applicationThank you for participating in my question. Of course, you ALL are right with the (ab)use of SQLite for such a task. But there are in the market some providers of such scenarios, unfortunately, to pay what separates for my hobby. Therefore I've decided for this supplier, which is for free. Please, let's go away from the theme SQLite, at all from the theme database. My original question was how to reconstruct the functionality of a language (C++) in another language (C#). To use a DLL with embedded class ... Is there even any further help? Thank you.
-
C++ DLL within C# applicationThank you for answering. My intention is a Server/Client solution, where the Server is on another remote machine than the Client. IMHO the System.Data.SQLite does not support this. Or am I totaly wrong with the mentioned dll?
-
C++ DLL within C# applicationHello, dear forum. I have a problem programming on C#. My recent activities with C++ are back over 20 years. I downloaded from the internet a server/client-solution for SQLite and am stuck in my C#-application using this dll.
HRESULT hr; HMODULE hMod = NULL; PDLLGETCLASSOBJECT proc = NULL; IClassFactory\* pFactory = NULL; //Get the module from list or load it hMod = GetModule( szDllPath ); if( !hMod ) return( false ); //Get Proc address proc = (PDLLGETCLASSOBJECT) GetProcAddress( hMod, "DllGetClassObject" ); if( !proc ) return( false ); hr = proc( IInterface , IID\_IClassFactory , (void\*\*)&Factory ); if( hr || !pFactory ) return( false ); hr = pFactory->CreateInstance( NULL, IInterface , pInterface ); if( hr || !pInterface ) return( false ); pFactory->Release();
What I've done so far (not much):
\[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode\] private static extern IntPtr LoadLibrary(String lpFileName); \[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true)\] private static extern IntPtr GetProcAddress(IntPtr hModule, String procName); \[DllImport("kernel32.dll", SetLastError = true)\] \[return: MarshalAs(UnmanagedType.Bool)\] private static extern Boolean FreeLibrary(IntPtr hModule); ... private static String DLLFile = string.Empty; private static IntPtr handleDLL = IntPtr.Zero; private static IntPtr handleProc = IntPtr.Zero; ... DLLFile = MyPath + @"Lib\\SQLQueryAS.dll"; handleDLL = LoadLibrary(DLLFile); if (handleDLL == IntPtr.Zero) throw new Win32Exception(Marshal.GetLastWin32Error()); handleProc = GetProcAddress(handleDLL, "DllGetClassObject"); if (handleProc == IntPtr.Zero) throw new Win32Exception(Marshal.GetLastWin32Error()); ??? and now ???
Then (unless I have understood correctly) it should invite a class, so you can responsive in this class located methods (procs/functions). Please help me. What should happen next? Thank you in advance.