I would like to auto-create an ad-hoc wireless network from my laptop.
I use windows XP SP3 and I want to do it using C#.
I have seen some libraries for mobile, but I havent found something regrading PC.
Is there an API to do that ?
Thank you.
Ad-hoc network are usually used in Ubiquitous Computing (smart homes). For a laptop, it depends what you'd like to connect to, as ad-hoc usually work with many devices you control.
May be you mean connecting to whatever network you can, in which case it's more on the OS-level.
If you are willing to setup one machine on the network as a wireless server and forgo Ad Hoc, then the Managed Wifi API on codeplex looks very promising. It is in C# and works on XP SP3 and higher (and a little bit on SP2, fyi). http://managedwifi.codeplex.com/
It uses the Native Wifi API from Microsoft. The Native Wifi API requires you to have a server machine which will hand out private IPs to other devices that connect to the network you create. In Native Wifi you would want StandAlone mode ICS in order to create your network (if you want internet access on your network use full ICS then).
http://msdn.microsoft.com/en-us/library/windows/desktop/dd815252(v=vs.85).aspx
Use the Native Wifi as just a reference though, Managed Wifi API is what you will want for C#.
I'm interested in this too actually. I think this could be useful:
http://msdn.microsoft.com/en-us/library/ms705973(v=vs.85).aspx
Unfortunately, this is only available for Windows 7 and Windows Server 2008 I believe.
I don't know any c#, but if I did, it'd probably make sense. If you find any insight, please contact me, I'd also like to learn how to do this as well.
Related
I am fairly new with MS Azure and developing remote apps.
Have read and viewed some learning stuff.
I use c# as my developing language, and as I have understood, its fairly simple to develop a windows application to run on an Azure server as remote app, which users anywhere on earth can run from their pc as if it was installed locally on their pc's. But in reality, it is more like, an RDP hiding behind the app.
The problem is that a database will be running on every users pc instead on the azure server. It is suppose to be like that by design, don't ask me why.
We tend to use "ms access" for the local DB, since everyone already have MS Office.
Anyway, back to the problem. What I am wondering is, how can I make my remote application on azure server communicate with the database installed locally on user(s) PC?
I have drawn a simple figure to explain what I mean.
http://snag.gy/ybyed.jpg
Back in the days when people used Modems to connect their PC's to the tubes, this would be theoretically possible (although maybe not a good idea). Nowadays, very very few PC's are connected directly to Internet.
In an Office, a PC will be connected via the company intranet to an external gateway and the PC will not be visible to anyone outside that gateway. The same is true at home, where the gateway is the router.
It would be possible with a lot of work to allow external access (from Azure) to the individual PC, but it would not be easy to set up. Further, you would need to write a piece of software to run on the PC which will listen on the correct Port for calls from Azure, will then run the appropriate SQL queries, and return the data to Azure. You might as well install SQL Server full edition on each PC.
Even if you do that, no security professional is going to let you actually open up the ports and firewalls to the internet; it's a lot of work doing that and you might as well just install random viruses on the PC - you'll get to the same point but faster and with less wasted time.
TL;DR: Not easy without a significant investment, and your PC will probably get trashed if you do.
This is actually possible by the magic of RDP protocol :)
Azure RemoteApp supports redirection for Windows machines as documented here: https://azure.microsoft.com/en-us/documentation/articles/remoteapp-redirection/
So, once you create an Azure RemoteApp collection, you can download the PowerShell cmdlets, enter your subscription ID and then you can enable drive redirection. This results in the local disk being mapped on the remote machine. You can try it out and see if performance is good enough.
The other alternative is that the database lives in an Azure storage account, as documented here: https://azure.microsoft.com/en-us/documentation/articles/remoteapp-anyapp/ .
You should NEVER store data on the Azure RemoteApp local machine.
/cd
I am writing a BT app on an android to connect to a lab device/hardware. At the present time I have a device on loan. However it is not possible for me to always have one while I am developing for it, (commuting, out of town, etc) Therefore I am creating an emulator for it and will run that emulator on my Windows desktop so that my Android client code can make connections to it.
The android code is built with .NET/xamarin and works fine connecting to the real device.
I am comfortable with C++ or C# on the desktop.
I have found this code http://www.codeproject.com/Articles/252882/Bluetooth-Server-Programming-on-Windows online to create and accept BT connections. it looks like a very good start for what I wish to do - which is build a state machine/emulator to mimic the real device. However I have been unable to connect my android device to it.
Note - the connection is a serial port connection. (the UUI coming from the android device is the "well known" serial port connection ("00001101-0000-1000-8000-00805F9B34FB")
I am not sure how to configure the windows 7 desktop and bluetooth services to allow this server/emulator program to accept connections.
I have paired the devices, but unable to connect.
How can I accept incoming Bluetooth serial connections in the C++ or C# code running on Win7 desktop?
If you want to do low level stuff like establish a connection via bluetooth through a C# app then you will need to access the bluetooth stack via its API. If your device is running the Microsofts Bluetooth Stack then you can look at 32feet.net's managed wrapper for Microsofts Bluetooth API. If you have the Widcomm stack then you will have to locate Widcomm's API for it.
To access the microsoft bluetooth stack, you can use the BthUtil.dll.
BthUtil.dll is an unmanaged dll which is part of the Microsoft Bluetooth stack. It's typically utilised for tasks such as turning the bluetooth radio on or off via a function called BthSetMode
(see MSDN for documentation - http://msdn2.microsoft.com/EN-US/library/aa456007.aspx)
You can check the following links:-
http://www.youtube.com/watch?v=Jn05CU3mxzo
Also, check the 32feet.Net
A Brief description of 32feet.Net
32feet.NET is a shared-source project to make personal area networking technologies such as Bluetooth, Infrared (IrDA) and more, easily accessible from .NET code.
Supports desktop, mobile or embedded systems.
32feet.NET is free for commercial or non-commercial use.
If you use the binaries you can just use the library as-is, if you make modifications to the source you need to include the 32feet.NET License.txt document and ensure the file headers are not modified/removed. The project currently consists of the following libraries:-
Bluetooth
IrDA
Object Exchange
Bluetooth support requires a device with either the Microsoft, Widcomm, BlueSoleil, or Stonestreet One Bluetopia Bluetooth stack. Requires .NET Compact Framework v3.5 or above and Windows CE.NET 4.2 or above, or .NET Framework v3.5 for desktop Windows XP, Vista, 7 and 8.
Link
http://32feet.codeplex.com/
Feature link for 32feet.Net
http://32feet.codeplex.com/wikipage?title=Feature%20support%20table&referringTitle=Documentation
And by this question I mean the user assigned names windows lets you type in like: "My home network" "Basement" "Garage" not the ssid (though I would also like to read that one for the wifi connections)
and I especially want to read the windows security levels that can be chosen for networks: Home/Office/Public
I want to use this information to switch programs on and off automatically when connecting to various networks.
Update:
Thanks to the answer of #Damien_The_Unbeliever I was able to solve my question and find the following information, I hope it will help others too:
Network awareness in windows 7 and vista (MSDN, Unmanaged)
Windows API Code Pack (Microsoft, managed wrapper for
NetworkListManager and others)
How to use the windows NLM API to get notified of new network
connectivity (Codeproject, Managed)
It sounds like you want to use the Network List Manager:
The Microsoft Windows networking environment allows multihomed computers to connect to several networks simultaneously. There may be multiple wireless networks available along with LAN and dial-up connections. Network List Manager identifies available networks and returns network attribute data to the application.
It's a COM API, I'm not aware of a managed equivalent.
I need to write a Windows application that accepts connections over Bluetooth SPP - i.e. other devices can see the SPP service and connect there. Tried googling but not much information available - any examples/meaningful docs/pointers out there?
The OS is Windows 7, using native Bluetooth drivers.
The preferred language is C#, but other ideas are welcome as well.
32feet.NET seems the obvious choice? http://32feet.codeplex.com/wikipage?title=Bluetooth%20Server-side
Speaking as its maintainer... :-,)
We have a .NET project that uses WMI and are interested in porting it to the Mono framework.
It appears Mono does not support WMI.
Are there any libraries that can add WMI support?
Basically we would want to access a Windows server using WMI from a Linux/OS X box.
Windows Management Instrumentation is a Microsoft implementation of WBEM (Web-Based Enterprise Management).
There are open-source implementations (eg openPegasus) that you might be able to use a client, but there's no telling what MS did with their version. If you can send CIM queries to the server, then you may get good results.
Note that Windows doesn't do WMI over http, only DCOM/DCE-RPC, so some clients will just not work. A quick google.. and OpenPegasus will allow you to access Windows using a WMI Mapper. If not, you could always run the server component on Windows.
Regarding WMI over HTTP, take a look at WinRM, which appears to be an implementation of WS-Management for XP, Win2003, Win2008, and Vista. This defines a way to access Common Information Model (CIM) information over HTTP(S) (SOAP). CIM is defined by the DMTF and WMI is Microsoft's implementation of CIM.
If I read the alphabet soup correctly, you should be able to use SOAP from Linux to access WinRM (WS-Management) on a Windows machine, thus providing access to WMI (as long as WinRM is installed, running, and not firewalled).
Whether running such a thing on a corporate network will be allowed by IT/Security is another matter entierely: any open port can be a security risk and one which allows command, control, and configuration by design can be quite a hole. Certificates, IPSec, and scoped firewall rules are your friend!
Note that I have no direct experience using WS-Management, nor WinRM, so YMMV.
I know you can install wmi-client on Linux (sudo apt-get install wmi-client). You should be able to query any wmi object on a Windows box from the Linux command line using this.