
10-10-2007, 16:51
|
 |
|
|
חבר מתאריך: 17.09.05
הודעות: 6,023
|
|
|
התחברות לLPT ב-C#
בניתי תוכנית שאמורה להפעיל איזה נצנוץ על לדים שאני מחבר לLPT......
בניתי את התוכנית מהמדריך הזה : http://www.codeproject.com/csharp/csppleds.asp
הבעייה היא שכלום לא מתרחש.... גם התוכנה המקורית והמקומפלת שהם נותנים להורדה לא עובדת...
אני יודע שאין אצלי שום בעיות בLPT כי תוכנה אחרת שהורדתי כן מצליחה לשלוט על לדים המחוברים לLPT ... רק חבל שלא ניתן להשיג את הקוד מקור של התוכנה שפועלת.
זה הקוד שבניתי:
קוד:
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
PortAccess.Output(888, 24);
PortAccess.Output(888, 36);
PortAccess.Output(888, 66);
PortAccess.Output(888, 129);
PortAccess.Output(888, 0);
PortAccess.Output(888, 129);
PortAccess.Output(888, 195);
PortAccess.Output(888, 231);
PortAccess.Output(888, 255);
}
public class PortAccess
{
[DllImport("C:/Users/אוהד/Desktop/LED_Source/inpout32.dll", EntryPoint = "Out32")]
public static extern void Output(int adress, int value);
}
}
}
_____________________________________

|