Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- set PATH=c:\Windows\Microsoft.NET\Framework64\v4.0.30319;%PATH%
- cls && csc.exe -debug- -target:exe -platform:x64 sx32w.cs && sx32w.exe
- */
- using System;
- using System.IO;
- using System.Runtime.InteropServices; // ez a névtér szükséges a DLL-ek miatt
- public class API
- {
- [DllImport("user32.dll")]
- public static extern int MessageBox(int hWnd, string text, string caption, uint type);
- }
- public class SPro
- {
- public static uint SPRO_APIPACKET_SIZE = 1028;
- public byte[] packet;
- [DllImport("sx32w.dll", CharSet=CharSet.Ansi, EntryPoint="RNBOsproFormatPacket")]
- public static extern ushort RNBOsproFormatPacket(byte[] packet, uint packetSize );
- [DllImport("sx32w.dll", CharSet=CharSet.Ansi, EntryPoint="RNBOsproInitialize")]
- public static extern ushort RNBOsproInitialize(byte[] packet);
- [DllImport("sx32w.dll", CharSet=CharSet.Ansi, EntryPoint="RNBOsproFindFirstUnit")]
- public static extern ushort RNBOsproFindFirstUnit(byte[] packet, ushort developerID);
- }
- namespace TryRNBO
- {
- class TryRNBO
- {
- public static SPro oSPro;
- static void Main(string[] args)
- {
- API.MessageBox(0, "Try it!", "MessageBox...", 0);
- try
- {
- uint status = 0;
- oSPro = new SPro();
- status = SPro.RNBOsproFormatPacket(oSPro.packet,SPro.SPRO_APIPACKET_SIZE);
- if (status != 0)
- {
- API.MessageBox(0, "FormatPacket: ok", "MessageBox...", 0);
- }
- else
- {
- API.MessageBox(0, "FormatPacket: isn't ok", "MessageBox...", 0);
- }
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message);
- }
- Console.WriteLine("Press any key to exit.");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement