I have an application which is working with generated licence (Mac-Id and some other hardware adresses). Everything works fine but if the user changes the internet connection from cable internet to Wlan connection or vice versa it gives a licence error. I know mac address will be changed if the internet connection is changed.
Is there a known solution ?
Any idea for this problem would be appreciated.
Using mac address is not a good idea cause users can change it manually. In your case Wireless NIC and Ethernet NIC has two different MAC addresses, So you should remember which one you used or not use MAC address at all.
I think you could enumerate all MAC address instead of using the MAC address of the active connection.
Also, this large post about How are Software License Keys generated? is quite worth a look.
Related
This has been one annoying piece of needle in a haystack.
The C# application is practically complete and I need to test the cooperation of two or more different machines on the same network, to see if they display the same data from the database.
When I run SQL Server + Visual Studio together during development, there's no problem, I use this connection string and everything works OK:
'#"Data Source=PCNAME\SQLEXPRESS;Initial Catalog=POS;";'
I have now published the app and installed it on another machine that happens to be on the same network. Obviously the connection string will not work on that machine because its name is not PCNAME, it's 2NDPC.
But I doubt the answer is to open the solution, edit the cnx string and re-publish for each machine. Even then, how will they be using the same database?
TL;DR
**What I need **
I want to use the machine I developed the application on initially to be hosting the database, to which the local machines can connect.
I've tried forwarding 1434 port and making rules, I've tried starting tcp/ip process in Server Configuration and making sure SQL Browser Agent Service or what not is running.
But no, I either get and error#25 or nothing happens.
Please help and tell me in explicit steps how I can achieve this goal.
1) Enable TCP/IP in the SQL Server Configuration Manager
2) Make sure SQL Server Browser is running, if not, start it, if you can't, right click > properties > service tab > Start Mode = "Automatic"
This is what (excluding people recommending firewall solutions, different programs/sites and downloading stuff to achieve this) I was missing, that nobody managed to tell me.
So .. depending on what you've been doing recently, you may or may not have changed some default values here and there. I'm not too sure if this is default, or if it happened with my win10 upgrade, but either way this worked.
3) In SQL Server Configuration Manager, right click on your TCP/IP item, hit properties, swtich to the ip addresses tab and put in 1433 in the tcp port field under IP1 and IPALL
Instead of pcname, try using TCP/IP address. PCNAME is Netbios dependant. You also need to make firewall adjustments, make sure SQL server is allowed for remote connections and listening on correct port (although 1433 is the default port, you are not guaranteed to have the correct instance on that port).
I have created and published a four part video series on this subject. Although it is about installing our application, 3 out of 4 parts deal with installing SQL server on the host, configuring it for remote access and accessing from clients. Check if you wish, here is the link to the 1st one:
AccuSQL Installation part 1
You need to load your connection string from a configuration file and on publish run a first run wizard or something similar to set the connection string the first time.
To get your 2NDPC to connect, all you'd need to use is the DNS name of the PC and it should work. You may also need to set SQL Server to allow connections on TCP/IP in SQL Configuration Manager.
Also FYI seeing your comment about using IP addresses, you're doing it right, but you don't use \\ in front of the IP. Just replace your PC name with the IP address. EG:
Data Source=192.168.0.1;Initial Catalog=MyDB; ...
I am trying to set up a shared folder with an old Win CE 5.0 device I am using to learn and improve my C# skills.
Possible options to do this can be done via console: net use sharedfolder \\mypc /user:foo /password:bar, to start an extra process from my C# application which then runs the console with the previous parameters or by using the function WNetAddConnection3.
However, I receive every time Error 53, ERROR_BAD_NETWORK_PATH.
I have checked the connection, as well as the path - always error 53.
A connection between another PC and \\mypc works fine without any problems. By comparison of my PC's network connection with the Win CE 5.0 device I have found out that there is only one difference: the Win CE 5.0 device has one WINS-server less. After setting the IP profile manually (IP Address, Subnet Mask, Default Gateway, DHCP, WINS), as well as adding the missing WINS-server, the problem disappears and the folder has been mounted successfully.
How can I fix this problem without changing the IP profile by hand?
In a normal network the WINS will be set by the DHCP server. The WINS entry of a network connection can also be set manually.
The problem with network sharing on Windows Mobile (WM) and Windows CE (WCE) is that it does not allow IP addresses, it only accepts windows network names. If you do not have WINS, a netbios network name can be resolved by the network card using a hosts entry, a broadcast or a WINS server.
As you do not have access to the DHCP settings of ActiveSync, you can either set WINS manually or by code or simply add a host entry for the connected PC. The activesync connected PC will can act as WINS server or , when you enter the netbios name for the netbios share server, the device can simply translate the netbios name to an IP. So either use the activesynced PC or the netbios server IP address as a WINS entry or add the name and IP of the sharing PC to the WCE/WM hosts table (registry: http://windowsmobilepro.blogspot.de/2006/04/etchosts-file-equivalent-in-windows.html).
[HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts\hello]
"ipaddr"=hex:a1,a3,a5,a9
"ExpireTime"=hex:99,99,99,99,99,99,99
I recommend to use the hosts entry solution and enter the name to use and the IP of the server you want to use.
I am on machine "MACHINEA" in my WiFi or LAN network, and am trying to authenticate a user with username "testusername" and password "testpassword" on machine "MACHINEB" in my WiFi network. I don't have a domain controller on this network. I want to validate credentials on a regular machine, just because it is visible on the network. I would like a solution or suggestion in C#, but I am open to other suggestions in other languages if I can fork into a different process that can return a value to me in a different language (if possible, please explain how I could do this as well).
I don't know what the equivalent in C# is but in C you can do this using the WNetAddConnection2 function. Note that this requires that you don't already have a connection to the computer, and that the computer is configured for authentication (i.e. simple file sharing is turned off.) You don't need to specify a local name for the connection.
How can I obtain the client MAC address with C# code of someone who visits my website?
You don't have access to the MAC, you don't need it. The MAC is only known to the router who the computer is connected to.
You can't get the MAC address of the sender, because you can't get mac address behind the first router on the path to the client.
To achieve that, you have to run some code on the client machine. MAC address isn't provoided in the internet. Store some cookie with a guid on the machine, that is not as disliked as running code on the client machine. ;-)
The best thing in my oppinion is to establish a user management on your website and give the peaople a chance to register / login. Then you can track everything around the user.
What i want is :
There is one windows app ( made in .NET 3.5, VS2008, C# ) for Windows XP SP2 & SP3
generally users can change there IP or modify their IP Address.
Now,when my apps starts i dont want users to change there IP Address untill my app stops.
Hope now question would be clear.
Need your advice soon.
Recommend solution in C# .NET or VB.NET only.
generally users can change there IP or modify their IP Address.
No they don't, it is a very privileged operation. An administrator account is necessary. On Vista and Win7 the UAC prompt has to be acknowledged. Preventing an admin from administering the machine is a lost cause and in general a hostile act. And pointless, the admin has all the required powers to kill your app.
Fix the real problem. The days that you could count on having your app run with an admin account are long gone. Anybody that runs Vista or Win7 is quickly going to uninstall your app.
I don't think there is much you can do to temporarily prevent users from changing their IP addresses.
On most machines the IP address is controlled by the DHCP server. If this server decides you need to change IP address, you have to follow or your connection is closed.
Administrators can change the IP address, you could remove a user from the admin group (but that does not prevent point 1). But that should mean you have a controlled user base (in an enterprise), and you should be allowed to do that. (And how are you going to put them back into the admin group if they are not an admin)?
Maybe the design of your application is wrong, if it depends on always having the same IP address. Or you should mention it in the "requirements".
For example: for un-interrupted "action", P2P clients (like Bittorrent) depend on having the same IP address, but they do not enforcing this.
I don't think you can block the access, but you can monitor the IP address, and when it changes you can roll it back to the old IP using WMI.