Virdi Unis error when distribute users data - c#

I m using Unis 3.1.1 with Virdi Ac7000 and gathered all employees fingerprints on one device and when trying to distribute users data all over other devices all emp data is transfered very well except the fingerprint
I tried on Access DB and Oracle and the same problem
is there any conf. has to be done or this is a bug in UNIS
I downloaded the VIRDI SDK from
https://drive.google.com/folderview?id=0B06Dxl8hzdKDZllHYlloU3lZbUk&usp=sharing
and tried to run the server within visual studio but also gave me 1002 error and didn't start although the example UCSAPI_Demo.exe in runs very well
using System.Windows.Forms;
using UCSAPICOMLib;
using UCBioBSPCOMLib;
namespace UCSAPI_DemoCSharp
{
public partial class test : Form
{
public UCSAPICOMLib.UCSAPI ucsAPI;
public UCSAPI m_Api = new UCSAPI();
public test()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
m_Api.ServerStart(999, 9870);
MessageBox.Show(m_Api.ErrorCode.ToString("X4"));
}
private void test_Load(object sender, EventArgs e)
{
}
}
}

This error is related to the dlls, your application is not accessing it well.
Pls, try putting all the VIRDI dlls, in the same folder of your application.

Related

AjaxPro not found class name in ASP.NET framework 3.5

I'm need to run my old project using ASP.NET webform with .NetFramework 3.5
So. I'm facing with problem missing ajaxpro javascript file (error 404) when I run test
Here is code I register Ajaxpro class
public partial class WebPage_Event_Event : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
pmSetClientAttributesControls();
}
}
private void pmSetClientAttributesControls()
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(WebPage_Event_Event));
}
[AjaxPro.AjaxMethod]
public bool Ajax_pmChkTimeOut()
{
return System.Web.HttpContext.Current.Session["Login"] == null;
}
}
So. when I run on IIS express in VS2022 I found this error
Any one know how to fixed this
Thank you.

Winform C# Read and execute source code from server

I have a winform app, I completed with business model and update function. But when I learn about security .Net, I found that almost impossible to anti crack/hacking with obfuscation.
So I want move 99.99% source code to cloud. But I've not found any doc that useful for making it.
Can I do my idea as below:
using ....;
namespace myApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public GetSourceClass()
{
// Here i want get all source code, include all class and all
// variables from server.Is it possible?
}
private void Form1_Load(object sender, EventArgs e)
{
GetSourceClass();
}

.NET application not fully working when using CLR Hosting API

I am loading a .NET application using the ICLRRuntimeHost::ExecuteInDefaultAppDomain method which starts the application up fine. However, the application is using Log4Net with which it should output an info message after starting up, but it never does. It works fine when opening it up normally though, so it must be something with the CLR Hosting environment that makes it unable to function properly, I just don't know what exactly.
Here is the code that does the logging:
using System;
using System.Windows.Forms;
using log4net;
namespace TestApplication
{
public partial class MainForm : Form
{
private static readonly ILog log = LogManager.GetLogger
(MethodBase.GetCurrentMethod().DeclaringType);
public MainForm()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
log.Info("Application has started");
}
}
}

Starting a WCF from its own class constructor

I have a self hosted named pipes (not using http) wcf hosted in a class library. I am able to start the WCF by using the following method in the class library:
ServiceHost serviceHost;
public void startService()
{
// Create the service host
...
// Open Service Host
serviceHost.Open();
}
And then from a winforms test program running the following from a button click:
MyClassLib.MySvc testSvc;
private void button2_Click(object sender, EventArgs e)
{
testSvc = new MyClassLib.MySvc();
testSvc.startService();
}
This does correctly start the WCF running in the class library.
But this requires the winforms that is referencing the class library to call startService method.
What I would like is just to be able to start the service as soon as a reference to the class library that will be running the WCF is done.
I have attempted to add the following in the class library service's constructor:
public MySvc()
{
startService();
}
And then instantiate from the winforms:
MyClassLib.MySvc testSvc;
private void button2_Click(object sender, EventArgs e)
{
testSvc = new MyClassLib.MySvc();
//testSvc.startService(); //No need to call this
}
If I debug the code, I can see that in fact it does break at this point:
public MySvc()
{
startService(); // It does run this but service does not start
}
But this does not run the service. Any help would be appreciated.
Note #1: I believe its some type of timing issue where it does not let you start the service during the constructor method but not sure of that.
Problem resolved and yes my assumption that it was a timing issue (See Note# 1 above) was correct!
To replicate, change this:
public MySvc()
{
startService(); // It does run this but service does not start
}
To this and problem solved:
public void delayStartService()
{
Task.Delay(1000).ContinueWith(t => startService());
}
public MySvc()
{
delayStartService();
}

Strange behavior of static variables in a web site

I prepared a very simple Web site to demonstrate this behavior.
It has one page with one Button and the following code:
public partial class TestStatic : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Class1.SetValue();
Label1.Text = Class1.st.ToString();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = Class1.st.ToString();
}
}
and one class:
public class Class1
{
public Class1()
{
}
public static int st = 0;
public static void SetValue()
{
st = 1;
}
}
So when the page is loaded you see in Label1 that st=1. If user clicks on the Buttton that sometimes you can see st=0 and sometimes st=1. In debugging I see that sometimes command
public static int st = 0;
is executed when an user clicks on the Button and this is a reason why st is changed to zero. This behavior I can reproduce in framework 4.5 only: it does not occur in framework 3.5. Can somebody explain me such behavior?
Static data lives per application domain instance. Since the hosting (IIS) can unload application domains between web site calls, static data can be lost.
So, you really shouldn't rely on static in web apps.
static values are shared across all instances of a class inside of a single App Domain.
If you're using IIS Express, your appdomain may be getting recycled more often than you think it is.
reference this: Lifetime of ASP.NET Static Variable

Categories

Resources