Information générale
Catégorie:
Code, syntaxe and commandes
>More bad news.
>
>I implemented a call from the ASP.NET page to a small VFP program (GetUserName.exe). And the VFP GetUserName, when calling GETENV("UserName") returns the damn computer name (with a dollar sign at the end). Just like the C# call to Environment.UserName. Even though when I call this function (GETENV("UserName")) in my main VFP 9 application it returns the real user name.
SYS(0) is the machine name I believe.
>Therefore, somehow, when the call is made from the ASP.NET page, the username is the computer name. That is, it does not work.
>
>3 hour of work wasted. But 3 hours of code that would not work, saved.
>
>UPDATE: What setting (in web.config) could be affecting the above? I use Windows Authentication in web.config.
The proper solution if you need data from a remote process would be to create a DLL and access its functions at startup, or to launch a parallel process and establish a named pipe between the two processes so you could write data back and forth, or use a window-based messaging system passing in the handle of an HGLOBAL memory block that allows you to transfer data back and forth.
You're accessing things that are available in the Win32 API. You should be using those functions to augment whatever .NET doesn't provide.
People under-estimate the power of Win32. Even going back to Win98 / Win2K, the power of that core OS functionality was / is amazing.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement