我正在编写一个通过 .NET 调用 OpenOffice.org API 的程序。http://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/CLI/Writing_Client_Programs上的文档说:
对于 OOo 3.x,代码如下:
//C# example for OOo 3.x
//Workaround which is needed when using a socket connection
//This will initialize the Windows socket library.
System.Net.Sockets.Socket s = new System.Net.Sockets.Socket(
AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
它在 Windows XP 和 Windows Server 2003 上运行良好,但在 Windows 7 上失败:
试图以访问权限禁止的方式访问套接字
我理解是因为套接字类型是原始的并且程序没有以管理员权限运行。所以我的问题是:如何在没有管理员权限的情况下初始化 Windows 套接字库?