I'm writing a C# winforms application that will transfer files from an iPhone or iTouch using the Manzana library.
My iPhone is called Mark's iPhone and I want this to display in the application. I can't find any simple way of finding this. Can anyone help. Please!
Pardon the vague answer, but I don't have the manzana sources in front of me.
To get the device's name, you need to call the AMDeviceCopyValue() function with the reference you have to the device and the key "DeviceName".
Pseudocode:
AMDeviceCopyValue(device, 0, "DeviceName");
First, go download the iTunes COM SDK. Create a new project and reference the library. I don't know anything about the library you're talking about, but I imagine it's built off of the SDK, so you may already have a reference.
The C# source code snippet below should get you the name of your iPhone. If it doesn't work, try ITSourceKindDevice instead of iPod.
iTunesApp app = new iTunesAppClass();
IITSourceCollection sources = app.Sources;
foreach(IITSource s in sources)
{
if(s.Kind == ITSourceKind.ITSourceKindIPod)
{
Console.WriteLine("Type: " + s.Name);
}
Related
// question
I have an existing c# program that uses Microsoft .net's "remoting" SDK.
I want to send some data from a new iOS app to this c# program.
The existing c# program is huge (with existing clients) and I am not sure if rewriting the entire thing in asmx is a good idea.
I have looked at other online sources, they all say no, but some mentioned Xamarin (wfc server).
Xamarin.Forms Connection to Wcf Service from iOS
I don't mind converting to iOS app to Xamarin, but just want to get some expert opinion before going ahead.
I am also open to other options as well.
Thank you very much for you help.
// what I have tried
I have looked at various stack-overflow posts & online sources and tried to use regular soap request instead, but I realized that this requires restructuring of entire c# codebase.
I would like to know if there is a smarter way to do this.
// update
I've tried Xamarin and it keeps crashing for some reason... when I try to use .dll reference.
I managed to download audio file from a remote source, and I want to change it's metadata, like Author, Title, Album.
I save it locally so it's easily accessible and editable, but I can't find anything to edit it's metadata.
I've tried:
Android.Media.MediaMetadataEditor but the error is pretty straightforward:
This class is obsoleted in this android platform
I'm using latest SDK (28) and API, for android Pie. And it is also stated on android developer documentation
This class was deprecated in API level 21.
Use MediaMetadata instead together with MediaSession.
I really searched for some example, and I didn't found anything useful, most of cases are with playlist.
I don't get how MediaSession can replace in any manner the MediaMetadataEditor, since MediaSession
Allows interaction with media controllers, volume keys, media buttons, and transport controls.
A MediaSession should be created when an app wants to publish media playback information or handle media keys
Instead MediaMetadata seems what I need because
Contains metadata about an item, such as the title, artist, etc.
And its Builder class is promising.
I'm sure that just reading that pages I should be able to understand how to do it, but after hours of trying, it seems I'm not experienced enough to learn from that documentation.
Is there an example to understand it?
Thanks
I found a solution outside android Library.
taglib-sharp seems working on android project, and it can be installed via nuget package, the name is TagLibSharp
Really easy to use:
TagLib.File my_file = TagLib.File.Create(path_to_my_file);
string[] performers = new string[1]{"My Performer"}
my_file.Tag.Title = "The real title";
my_file.Tag.Performers = performers;
my_file.Save();
Easy.
I am developing a C# program in WPF which scans a fingerprint, stores it somewhere on local disk and then read it in another program for further manipulation.
For fingerprint scanning, i am having futronic device FS80. I have got all the required dlls in the CD but the biggest problem for me is those dlls are not valid COM components so not able to add them as a reference in my project. Anyhow I managed to add them using dllImport through coding but now I dont know which are the functions the dll contains and what are their parameters and use.
Totally stuck at the first phase only. Very frustrating because its my first attemp with wpf and device integration.
Can anyone please guide me how to integrate FS80?
I searched on futronic site but they are only providing sample exe and no code.
If anyone is having any type of idea please share.
I found something helpful.
http://read.pudn.com/downloads110/sourcecode/math/457634/FingerprintDemo/fingerprint/ftr%20scanner/ftrScanAPI.h__.htm
It is not in C# but it will give an idea
Recently stumbled upon this post whilst trying to decide on the best way of getting a VLC player into C#.
Does VLC media player have a C# interface?
I downloaded the dll files and imported them into my project, but then realised I had no real idea of how to use them. Has anyone got a Windows Forms example of this code that works? The code have tried is shown below -
Vlc.DotNet.Core.Medias.MediaBase media = new
Vlc.DotNet.Core.Medias.PathMedia(#"C:\Users\...\SampleVideos\Wildlife.wmv");
Vlc.DotNet.Forms.VlcControl vlcControl1 = new Vlc.DotNet.Forms.VlcControl();
vlcControl1.Play(media);
I am also using the code in this link in the main program.cs of my project.
http://vlcdotnet.codeplex.com/wikipage?title=Forms
The current problem I experience is that upon starting the project it throws a NullReferenceException when it gets to ->
vlcControl1.Play(media)
The problem seems to be with the vlcControl but I am unsure why. The documentation seems to rather thin and I couldn't find any working examples on the codeplex site. If anyone has a working forms example or knows what I might have missed please let me know!
Here is the call stack present when the error occurs ->
RTSPViewer_Test.exe!RTSPViewer_Test.Form1.Form1_Load(object sender,
System.EventArgs e) Line 31 + 0xd bytes C#
RTSPViewer_Test.exe!RTSPViewer_Test.Program.Main() Line 30 + 0x1d bytes C#
When debugging it appears that the Media and Medias attribute of the VLC control are both null. When trying to set the Media of the control to the media object created above a
NullReferenceException
Checking the VLC control object Media does indeed equal null, but I am not sure why it hasn't been initialised properly.
I was unable to get the program to work using the latest version of the Vlc.dotnet libraries but instead used the alpha 2 version which was posted by Raj. I used VLC version 1.1.5 with this library to get the basic example to function properly. My end objective was to stream from an rtsp device, however this library does not appear to support this functionality yet.
For anyone looking to use a good C# wrapper for using VLC then this is a great example -
http://www.codeproject.com/Articles/109639/nVLC
Used the library files from VLC 1.1.1 with this project and works fine. Supports pretty much all the features that you would usually use in VLC but gives you much more control over what you use them for.
Many of the issues that arise when using these DLL wrappers arose from incorrect versions of the source DLL files. The VLC libraries are only 32 bit at this time, so you need to make sure to compile using x86 mode otherwise the libvlc.dll will not load properly and the application will crash. Using the above example you must also make sure that the libvlc.dll, libvlccore.dll and the plugins folder are included in the build folder.
I want to display live image from the usb PC webcam using C# windows application in Visual Studio 2010. I have searched about that and find the link http://channel9.msdn.com/coding4fun/articles/Look-at-me-Windows-Image-Acquisition but when i tried this code
WIA.CommonDialog class1 = new WIA.CommonDialog();
Device d = class1.ShowSelectDevice(WiaDeviceType.UnspecifiedDeviceType, true, false);
if (d != null)
{
settings.DeviceID = d.DeviceID;
settings.Save();
}
I am getting the giving compilation error
error CS0103: The name 'settings' does not exist in the current context
And I am not able to find out the solution for this error.
Can anybody body please tell me what would be the solution for this error?
And Is there any other best method to display live images from usb webcam?
Any help would be appreciated....
Thanks in Advance..
It looks as though you haven't defined a settings object, however it doesn't seem to be in the tutorial either. Personally though I would use AForge.NET library as this provides an extremely easy interface to webcams.
http://aforgenet.com/
Tutorial: http://vimeo.com/7526663
Thanks
AForge.NET is very powerful library. But for testing purporse or simple project you could use WIA. Take a look at this tutorial - small example how to start