scanning a system for shared folders in lan - apache-flex

I am developing an application in flex 3 using action script 3.........
I have some range of ip address in LAN(wired or wireless both).....i want to check which all the systems available...and also want to see their shared folders.....can anyone give some code or reference in action script....
Thanks to everyone...

Actually, I don't think it's possible at all with Flex due to sandbox violation of the Flash Player and/or not supporting it.
I don't know if Air supports network access in this way. Check this out for more information on Adobe Air.

MysticEarth is right, Flex cannot access the operating system directly because of security issues that might arise.
However, you can solve it in two ways:
Adobe AIR 2.0 Command-Line Integration:
Server-side script
Adobe AIR 2.0 can now run native processes! So you could have it access your operating system, check the systems available, shared folders, etc. Here's an example on how to execute native processes with AIR 2.0
The current standard is to just use Flex and HTTP to a server side script. To do something like what you're describing, I would create a ruby/php/python script or whatever, send a restful GET HTTP request to that script (say GET /shared_folders), and have that search the OS for what it needs, and return it as XML. Then you can use Flex. If you don't want to do that, AIR 2.0 is the only option.

Related

How to use WinPcap in Xamarin (Forms)

There are many .Net wrappers in C# for WinPcap like SharpPcap and PcapDotNet
I have tried to add these Nuget packages to my Xamarin Forms projects but it does not work. I want to create a wifi/packet scanner but I am not sure how to do this in Xamarin. Is it even possible?
When I clone the GitHub repo and build my own version of SharpPcap, the application runs, but I get the error:
System.DllNotFoundException: wpcap
The wpcap.dll is the dll that all these packages are wrapped around and use [DllImport("wpcap.dll")] to work. This wont work in Xamarin (I think).
Another way to use dll's is when you embed them as an application resource, is there any library which I can use that does that?
WinPcap consists of a driver, that extends the operating system to
provide low-level network access, and a library that is used to easily
access the low-level network layers. This library also contains the
Windows version of the well known libpcap Unix API.
Source: https://www.winpcap.org/
There is nothing impossible, however in mobile world you don't have that low level access to drivers and etc. unless you have a root on your device. It is unclear what exactly you want to build. But I know that on both iOS & Android there is an app called Fing. It scans your WiFi network for connected devices. It is written natively per platform. On Android there used to be many different applications that used MITM technique. For example DroidSheep. But I am not aware of any cross-platform solution that is able to scan the network or sniff packages.

Could Native Client web application create windows and common controls while runtime?

I talking about Native Client thing for google chrome...
Developers claim it can run native code compiled from c / c++ in browser's sandbox.
They describe a lot of things, but never point at what I need... So, if I create window in my application with CreateWindow, would this window appear when my Native Client application loaded into browser?
In short, no. Two key things to know about apps that use Native Client in Chrome:
They are platform independent (platform-specific calls are
disallowed).
They are still web apps with the restrictions and possibilities that come with that.
If Native Client allowed operating system-specific calls like CreateWindow, it would no longer be platform independent (and it would also present a security risk).
Instead Native Client provides a set of platform-independent APIs called Pepper or PPAPI that work the same for all supported operating systems (currently that's Mac OS, Windows, Linux, and Chrome OS). As mentioned, apps that use Native Client are still web apps, so Pepper gives the same possibilities and restrictions that you'd expect from JavaScript. E.g., you can fetch URLs or ask the user for fullscreen permission, but you cannot access any random file from the local file system (app-specific isolated local storage is possible; as is having the user upload a file for the app to use).
Moving an existing C or C++ codebase to Native Client is very much like porting to a different operating system. Instead of using, say, Windows API calls, your app should use Pepper API calls.
For additional background it may be worth noting that Chrome Packaged Apps can request access to a much wider set of APIs in the chrome.* namespace. These APIs include USB, sockets, opening new windows, and more. A Chrome Packaged App will still not be allowed to make OS-specific calls, but they have access to quite a few more APIs, all of which are platform-independent.
In short, if your app can be made to work with the Pepper API plus the chrome.* APIs, you could write it in Native Client and JavaScript, and you'd have an app that worked the same way across the four operating systems mentioned above. If your app cannot be made to work with those APIs, Native Client in Chrome is not the right choice.
Seems not.
This is a bit related: http://ssj-gz.blogspot.com/2013/01/emscripten-qt-progress-faster-better.html. It's translated to javascript, though, and only for QT. And slow.

Can Flex 4 or Actionscript access shared C or C++ library?

I'm having a Flex4/Actionscript application developed for access in a web browser. I need it to perform some math involving imaginary numbers (e.g. sqrt(-1)). I don't believe either Flex or Actionscript supports this.
However, I can put all of the math algorithms in a shared C or C++ library (as created by Matlab). Can Flex or Actionscript access these algorithms (and run them on the client)? Any better way to accomplish this?
Can Flex or Actionscript access these algorithms (and run them on the client)?
Sort of. You can use Alchemy to use C/C++ libraries in the Flash Player. I'm not sure exactly how it works. The project is experimental, but Adobe has announced they have a new version coming and that they will "commercialize" it. I assume that means tools will be rolled into Flash Pro or Flash Builder.
This was the technology behind the 2011 Adobe Max Keynote that displayed a game made with the Unreal engine running a browser.
Some quick searching came up with this AS2 library which may help without going the C route. ( Source ). You'd probably want to convert it to AS3, but I would expect that to be minimal.
As an alternative to Alchemy you can use FluorineFx Aperture Framework. It adds a feature to use LocalConnection to exchange data between AIR app and some sort of C++ dll. The advantage is that this dll is truly native, you can compile it in e.g. Visual Studio, use all the features of C++ without restrictions. The disadvantages are following: unreliable LocalConnection, limitation to use AIR, limitation to run on Windows only.
Another method we used on one of the projects is exchanging data between two separate applications: native and AIR, i.e. you have "server" application and "client" AIR. As "protocol" we simulated LocalConnection at first, but then switched to Windows Pipes as more stable. Another way is to use local sockets.

How to Protect program from using on the SERVER?

I have a progam this is a converter for .NET that can be used in other .NET projects.
I have two kinds of license:
Developer license for DESKTOP software
Developer license for WEB server deployed software.
How I can protect my program if client buy (1) license he CAN NOT use it on the SERVER.
Disclaimer: I don't know anything about .Net, other than how to spell it, and I'm not completely sure about that.
It seems like one difference between a person using your file converter on their desktop and using it on a web server is that only a single instance will be running at a time on the desktop; a web page will probably have multiple instances, once per concurrent request. This seems like something you could enforce in software, and also something you could easily write into a license agreement.
Does IIS run with a graphical console on Windows? If it doesn't, and your desktop version does, maybe you could detect that?
Ultimately, though, if someone wants to get around your server/desktop distinction enough, they're going to; they could, for example, have the web server send the document to a desktop machine, and have the desktop send it back to the server. So, at some point, you'll have to give in and either ignore it or to say that's a problem for legal to handle.
If it is desktop software (I'm not sure by the question with the tag), you could use the Environment object to check what OS the code is running on and stop it running on Server Technology. This won't help if they run a server using XP or the like though, but it's a start.

Desktop sharing application in Flex?

I want to make an application in Flex for desktop sharing. How should I proceed?
You won't be able to access desktop via Flex, you'll have to use some server app on the user machine to simulate mouse/keyboard events.
For example, you can use any VNC server (http://www.realvnc.com/products/free/4.1/index.html) with the Flex VNC client (http://www.wizhelp.com/flashlight-vnc/).
Want to compete with Fog Creek CoPilot? ;-)
Well, I doubt that Flex running as SWF in a browser is able to do this due to sandbox limitations. Maybe, if you run Flex as AIR application, but I still doubt that AIR provides that level of access to the OS.
For Java there may be libraries that can do something like this using native interfaces.
Don't know how Copilot is doing this. I guess either using an Active X control or an native application that has to be installed.
After all I really doubt that you will be able to do this with Flex.

Resources