Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to call a third party dll file in Java

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you about how to call third-party dll files in Java, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

Java language calls the use of third-party dll files System.load () or System.loadLibrary ()

Public class OtherAdapter {static {/ / System.loadLibrary ("Connector"); / / load the dll Connector.dll System.load to be called ("d://Connector.dll"); / / load dll Connector.dll} / / modify the corresponding function declaration public native static int _ PWLogon (String lpszDS,String lpszUser,String lpszPWD) in the method / / dll file to be implemented in other languages with the native keyword / / function declaration public native static void _ PWLogout (); public native static String _ GetPWLastError (); public native static String _ GetPWFolders (long lParentFolderno); public native static String _ GetPWDocuments (long lFolderno); public native static String _ GetPWFiles (long lFolderno,long lDocno); / / public native static String pirntStr (String msg) / / function declaration public static void main (String [] args) {/ / local method call int rs=_PWLogon ("server", "account", "password"); System.out.println ("user login status:" + rs) If (rs==1) {System.out.println ("get top-level directory:" + _ GetPWFolders (0)); System.out.println ("get parent-child directory:" + _ GetPWDocuments (54)) System.out.println ("download specified file:" + _ GetPWFiles (54 GetPWLastError 2)); _ PWLogout ();} else {System.out.println ("get error message:" + _ GetPWLastError ()) } the above is how to call third-party dll files in Java. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report