I have a question about opening a file stored in IsolatedStorage in my Windows Phone 8 C# app (in my case a file.txt file)
and opening it up in Office suite integrated in WP 8.
I have come up with this:
Windows.System.Launcher.LaunchUriAsync(new System.Uri("ms-word:" + (new Uri("file.txt", UriKind.Relative))));
It opens up Office Word with no problem, but it hangs at the "file does not exists" message and quits..
Any advice ? Thanks :)
Your Uri is wrong. It should be new Uri("ms-word:isostore:file.txt", UriKind.Absolute);
But still, the file can't be opened. Don't know why.
EDIT: This is not possible. You can only open office email attachments or office documents from OneDrive.
http://answers.microsoft.com/en-us/winphone/forum/wp8-wppersonal/open-word-and-excel-files-from-sd-card/23218c41-b72b-49df-9529-5e85a1912bc5
Related
I need C# code to open the WhatsApp desktop application instead of open WhatsApp on the web.
I tried
Process.Start("https://web.whatsapp.com/send?phone=" + textBox1.Text);
but it opens WhatsApp on the web, instead of the WhatsApp Desktop application.
I want to open this link in desktop WhatsApp application
The desktop version of WhatsApp can be found in %LocalAppData%\WhatsApp\Whatsapp.exe.
You get the environment variable with
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
Use Path.Combine() to get the backslashes right when combining multiple paths.
Note that the executable above likely just starts another version of WhatsApp.exe. The latest version seems to be in the default key of the Registry at
HKEY_CLASSES_ROOT\whatsapp\shell\open\command
Starting point for an implementation: Registry.ClassesRoot.
Try using the whatsapp protocol:
var process = $"whatsapp://send?phone={textBox1.Text}";
Process.Start(process);
You can append the text argument to send a text:
whatsapp://send?phone=5555555555&text=hello
Using Process.Start(#"C:\clip.mp4") will open video with default apps.
How can I open it with app "Movies & TV" (it's not default app) in C# Windows Form?
Necroposting here. I have had found out that you could treat the mswindowsvideo:// protocol as an application path on the command line.
Simply write on a command line or shell:
start "mswindowsvideo://" "<filePath>"
In your code, that would be: Process.Start("mswindowsvideo://", filePath);
For UWP you can use Launcher.
await Windows.System.Launcher.LaunchFileAsync(storageFile); //in my case this is .mkv file
Trying to automate file downloads, using Watin in IE. Have a 10 documents to be downloaded and i could find that the below code will prompt for download option.
string download_url="link to file";
browser.Goto(download_url);
I would like to automatically save these files into a new directory with custom names for each files. Is it possible without user prompt for saving files in IE(vesrion 8 and above). Please guide me with a solution for this issue.
From your question I can find several other responses right here. Like this one:
Downloading a file with Watin in IE9
using(IE ie = new IE(someUrlToGoTo))
{
FileDownloadHandler fileDownloadHandler = new FileDownloadHandler(fullFileName);
ie.AddDialogHandler(fileDownloadHandler);
ie.Link("startDownloadLinkId").ClickNoWait();
fileDownloadHandler.WaitUntilFileDownloadDialogIsHandled(15);
fileDownloadHandler.WaitUntilDownloadCompleted(200);
}
I m saving image into local folder for my windows phone application
var localFolder = ApplicationData.Current.LocalFolder
var photoFile = localFolder.CreateFileAsync(("mani"),
CreationCollisionOption.ReplaceExisting);
I m saving file without extension while save into locally for security reason and avoid other apps to view.
When i search google i got this api for launch default apps for file
Windows.System.Launcher.LaunchFileAsync(photoFile);
But my local file dont have extension so i can't use this Api for default application launch could you please guide me alternative solution for this
Thanks,
in my app i want to get all paths of recent used document in windows 7 (for all types of documents) , i am using c# ,so is there any method to do that ? help me please? .
thanks
Use Environment.SpecialFolder.Recent:
string path = Environment.GetFolderPath(Environment.SpecialFolder.Recent);
var files = Directory.EnumerateFiles(path);
This kind of data is stored in the registry. A Google search led me to the following:
Description: Recently opened files from Windows Explorer
Location: C:\Users\\AppData\Roaming\Microsoft\Windows\Recent
Description: Recently Opened Office Docs
Location: C:\Users\\AppData\Roaming\Microsoft\Office\Recent
(from: http://www.irongeek.com/i.php?page=security/windows-forensics-registry-and-file-system-spots)