Check path if it is in virtual device or not, writable or not

Hi everyone,
I'm currently making an application which encrypt file and users can decrypt the file anytime they want. After encrypting the file, I will delete the original file and when I decrypt, I will re-create the file to original position.
The question is : How can I check if the selected file or folder is in virtual device or removable devices such as CD-ROM ? Because we can not write file on them. 
And how to check if the path is writable or not :) .
Thank you :)

 >>How can I check if the selected file or folder is in virtual device or removable devices such as CD-ROM ?
Take a look at the PathIsNetworkPath Win32 function and the DriveType property of the System.IO.DriveInfo as described in the following thread:
http://stackoverflow.com/questions/2243569/check-if-path-is-on-network
>>And how to check if the path is writable or not :) .
You could try using the FileSystemSecurity class:
http://stackoverflow.com/questions/1281620/checking-for-directory-and-file-write-permissions-in-net.
But the easiest way is to try write to the file and then catch any exception that is being thrown if the write fails for some reason:
https://social.msdn.microsoft.com/Forums/en-US/f81bea37-26f5-44d8-bac4-bc534bbb03b4/c-how-to-check-file-folder-if-writable?forum=netfxbcl
There is however no boolean property of the FileInfo class called "IsWritable" or something if that is what you are looking for.
But please don't post any more questions that are not related to WPF in this forum. There is a C# forum for these type of questions:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral
Please remember to close your threads by marking helpful posts as answer.

Similar Messages

  • Program working in virtual device, but not on physical device

    I made a program, pretty simple, actually, that simply consumes a web service here on my local network.  Pretty much all it does is try to authenticate.
    I had a problem with DNS before with the androids, so i replaced all of the domain names in the service xml files to IP addresses,  which still works virtually, but again, not on the physical device.
    Any ideas?

    Hello,
    Regarding the procmon capture;
    Yes, it is a lot of data. I would just start at the top and read my way down on both captures and then identify areas which they differ. Without understanding where the two captures differ, well - it would seem hard to understand where the difference in
    behaviour starts?
    Of course you can minimize the data by (this seems rather obvious, but lets re-iterate);
    1. Avoid all and any unnecessary background tasks
    2. Monitor normal system activity and exclude that
    3. Learn the application behavior and decide if you want to monitor only the application, or all system activity
    4. Understand the application
    As you have a working / non-working scenario - this seems like a perfect scenario of using ProcMon.
    Nicke Källén | The Knack| Twitter:
    @Znackattack

  • Solaris 10 Storage multipathing virtual devices

    Hi all,
    In Solaris 10, after enabling the storage multi-pathing using "stmsboot -e", the newly created virtual devices with long names containing the WWW. Is it possible to rename those device names? Actualy, in the Oracle 10g RAC, it is required that the two nodes see the same device names for the shared storage, so is it possible to rename the multi-path devices?
    If not, then is it possible to create links to those devices so that the links them selfs wil be used in the Oracle setup? would it be safe to use the regular hard links? or is it possible to create a new device file pointing to the multi-path device and have this device file name the same on both RAC nodes?
    Best

    Any ideas?

  • Virtual Device Driver format in the registry is invalid

    Hi,
    I have the following error occur when I try to install Java development kit from Sun (j2sdk-1_3_1_02-win.exe) onto my window's 2000 laptop:
    SYSTEM/CurrentControlSet/Control/VirtualDeviceDrivers. VDD. Virtual Device Driver format in the registry is invalid
    Checking my registry there is only a default string value, the binary value VDD does not exist. (I can see it on other people's laptops)
    Is it possible to fix this?

    Microsoft has a manual workaroud to fix this: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q254914

  • Can multiple Virtual Devices use the same IVI Driver Sessions?

    I am using Switch Executive 2.0 and I'm having problems creating multiple Virtual Devices.
    I have created a virtual device on a development computer that has no hardware connected to it.  This virtual device uses specific drivers to simulate the devices.  The problem I'm having is that when I create a second virtual device and try to add the same IVI Switches as the first Virtual device, I'm getting the following error:
    An error has occurred while attempting to access the device deviceA_ivi.
    Error -223116 occurred:
    Internal Software error occurred in Switches software.  Please contact National Instruments Support.
    File name: .\source\mxsWrappers\tMXSObject.cpp
    Line Number 192:
    Status Code: -223116
    Can someone please explain why?

    Can you please elaborate on how did you create those simulated devices? Namely, what does your IVI configuration look like? What does the driver session for the logical name look like? What's the software module? What's the hardware module? What is the driver setup string, and what is the simulation mode for the device in question?
    -Serge
    Srdan Zirojevic

  • How to check the hardware vendor of a particular device

    Hi every one
    in the recent interview i have taken he asked me a question like
    how to check the hardware vendor of a particular device
    ex: hard disk ,nic card ,ram
    Thanks in Advance.......

    hi
    depends on OS version
    in RedHat like distros e.g.:
    lspci, lsusb, ls...
    dmidecode|grep -i manuf
    kudzu -p -s
    on Solaris you can use these :
    dladm show-dev
    dladm show-link
    prtconf -D
    kstat [-P]
    Edited by: g777 on 2011-03-11 07:24

  • Flash Builder 4.5: debugging Flex Mobile application on Android Virtual Device

    Hi,
    we are trying without success to debug a flex mobile application in Flash Builder 4.5 on an Android Virtual Device (AVD).
    We can debug with real Android devices via Flash Builder 4.5, by using a standard Mobile Application debug configuration with "On device" launch method, but emulated devices are not listed in the "Choose device" Flash Builder 4.5 window.
    The emulated device is correctly listed by "adb" command line tool, as the following screenshot shows:
    c:\Program Files (x86)\Adobe\Adobe Flash Builder 4.5\sdks\4.5.0\lib\android\bin\adb" devices
    List of devices attached
    emulator-5554   device
    ("emulator-5554" has been created and started with Android AVD Manager standard Eclipse plug-in)
    By using the adb command-line tool we can also install applications on the emulated device, but we'd like to use Flash Builder 4.5 directly, without manually using adb.
    Many thanks in advance for any direction.
    PS: we can debug with Flash Builder "internal" android emulator (the one used with "On desktop" launch method), but we want to use the more "realistics" android emulated devices provided by Android SDK (Android Virtual Device (AVD)).

    well that's just ... oh what's the word I'm looking for? ... um ... ah yes - inconvenient.
    I've been wrestling with this too. I use VDs with eclipse all the time, I'm wondering why it's not supported in flashbuilder. I mean, it's just a VD that runs on a virtual port, plugs into the editor like a read device would - right?
    I'm going to take a wild stab at this and say it probably has something to do with running a program inside (Air) a virtual machine, running inside a virtual machine inside a virtual device?

  • Why can't I install virtual devices in NI-Max with windows 7 and DAQmx 8.7.1

    Hi all!
    I just got some new machines running Windows7 32 bit. The old ones didn't survive a fire, the DAQ devices were resqued. After I installed DAQmx 8.7.1 including NI-MAX I found out that my device (PCI-6014) wasn't displayed in the device section. The device was however displayed in the windows hardware section!!
    I also wasn't able to setup a virtual device other than some RTSI-cable. NI-MAX version is 4.1.1.
    I cannot use a newer version of DAQmx as I have to work with LabView 7.1.
    Another machine, same windows7 and same DAQmx didn't give me this problem, so what could possibly be wrong? Can't use this machine as it has no high PCI slots in it....
    Regards,
    Ronald

    I think you're right about that one, I should have upgraded every time when I got the new CD's. On the other hand, I developed some way in reusing quite a lot of my work. So I only have to update these vi's in order to get my programs running again I guess. The nice thing of it is that this would be the perfect opportunity to go through my work of the past 7 years and look what's really needed and what can be thrown in the bin.
    About the LV7.1 version: You're right. NI allows you to use them besides your new versions. I think I've got to play a little around with my virtual machines in order to get multiple versions (and multiple DAQmx versions) running aside of each other. Lucky for me is that a lot of analysis is done after the DAQ has been done!!
    Thanks,
    Bye

  • Ask the Expert: Basic Introduction and Troubleshooting on Cisco Nexus 7000 NX-OS Virtual Device Context

    With Vignesh R. P.
    Welcome to the Cisco Support Community Ask the Expert conversation.This is an opportunity to learn and ask questions of Cisco expert Vignesh R. P. about the Cisco® Nexus 7000 Series Switches and support for the Cisco NX-OS Software platform .
    The Cisco® Nexus 7000 Series Switches introduce support for the Cisco NX-OS Software platform, a new class of operating system designed for data centers. Based on the Cisco MDS 9000 SAN-OS platform, Cisco NX-OS introduces support for virtual device contexts (VDCs), which allows the switches to be virtualized at the device level. Each configured VDC presents itself as a unique device to connected users within the framework of that physical switch. The VDC runs as a separate logical entity within the switch, maintaining its own unique set of running software processes, having its own configuration, and being managed by a separate administrator.
    Vignesh R. P. is a customer support engineer in the Cisco High Touch Technical Support center in Bangalore, India, supporting Cisco's major service provider customers in routing and MPLS technologies. His areas of expertise include routing, switching, and MPLS. Previously at Cisco he worked as a network consulting engineer for enterprise customers. He has been in the networking industry for 8 years and holds CCIE certification in the Routing & Switching and Service Provider tracks.
    Remember to use the rating system to let Vignesh know if you have received an adequate response. 
    Vignesh might not be able to answer each question due to the volume expected during this event. Remember that you can continue the conversation on the  Data Center sub-community discussion forum shortly after the event. This event lasts through through January 18, 2013. Visit this forum often to view responses to your questions and the questions of other community members.

    Hi Vignesh
    Is there is any limitation to connect a N2K directly to the N7K?
    if i have a an F2 card 10G and another F2 card 1G and i want to creat 3 VDC'S
    VDC1=DC-Core
    VDC2=Aggregation
    VDC3=Campus core
    do we need to add a link between the different VDC's
    thanks

  • Delete a virtual device in a VI

    Hello,
    By programming a VI, I can't delete a virtual device which exist in MAX configuration.
    By programming in a VI :
    I open a session to NISE on my system
    Then I get a reference from the virtual device that I want to delete
    Then with this reference I delete the virtual device
    Then I close the session to NISE.
    But when I open MAX the virtual device is still here (with this message there is a JPEG file of the diagram).
    Perhaps someone can explain to me how to do ?
    Sincerely
    For information I use : LabVIEW 8.2 and NISE 3.0
    Attachments:
    diagramme.jpg ‏40 KB

    See here

  • My iPhone 6 shows "No Service".  Why?  My device is not set to Airplane Mode and I've already checked my Cellular settings to make sure that's all right.

    My iPhone 6 shows "No Service".  Why?  My device is not set to Airplane Mode and I've already checked my Cellular settings to make sure that's all right.  Obviously I can't call Verizon to find out why I have no service, and their online Live Chat isn't working.  What to do?

    Try this link:
    iOS 8.0.1 Causing No Service, Touch ID Issues on iPhone 6/6 Plus, Apple Support Recommends iTunes Restore - Mac Rumors

  • NI Switch Executive error when attempting to add NI PXI-2566 switch to new virtual device.

    I just loaded Switch Executive and am wanted to explore its capabilities. I have a PXI system that I am setting up. Currently I have PXI-2566 cards in slots 8 and 9.
    I was following the NI Switch Executive help documentation "Creating a Virtual Device" and attempted to create a virtual device with the 2566 modules and I got this error;
    Error xBFFA000A occurred.
    Failure loading driver module.
    The driver for the DAQmx switch is not loaded.[DeviceXI1Slot9_ivi]
    Attachments:
    SwitchExecutiveError_01.bmp ‏229 KB
    SwitchExecutiveError_MAX.bmp ‏364 KB

    I had not loaded the "NI-DAQ 7" software that came with the 2566 switch card. I assumed that since MAX showed that I had version 7.2 of DAQmx that I was already up to date.
    I received a new PXI-2532 switch, and when I got a "driver not found" error in Switch Executive when I tried to add the 2532 to a new virtual device, I had second thoughts on running the setup/install from the new discs.
    After running the software install, I was able to add the 2566 switches to a virtual device in Switch Executive. However, the 2532 failed.
    Error xBFFA4B4A occurred.
    DAQmx Error -200181 occurred:
    Channel name specified is not valid for the switch device.
    Device: PXI1Slot10
    Channel Name: r4
    Attachments:
    SwitchExecutiveError_02.bmp ‏35 KB

  • Bootcamp 3.2: Microsoft Virtual WiFi MiniPort Adapter shows "device is not working properly...Code 31"

    Using Windows 7 Enterprise 64-bit, Microsoft Virtual WiFi Miniport Adapter shows the "device is not working properly because Windows cannot load the drivers required for this device. (Code 31).".The device is the Apple iMac10,1 All-in-one computer. Right clicking browse files (for the device) shows the Bootcamp (C:), DVD (D:); and my external hard drives can be selected.
    Internet and WiFi connections all working ok. Am also running MacDrive 8 to access the Mac drives when in the Windows partition, again without any seeming issues.
    Updating the driver simply generates another Code 31 error.
    Appreciate this seems to be a known problem - is the a solution a novice use might be able to follow or should I simply ignore the error message?
    Driver Date us 21/06/2006 and Driver Version is 6.1.7600.16385.

    Hi  ,
    Thank you for visiting the HP Support Forums and Welcome. It is a great site for information and questions. I have looked into your issue about your HP ENVY 4-1204tx Ultrabook and issues with WiFi adapter is not working properly. Error codes in Device Manager in Windows  8.1 could be fixed by deleting any extra drivers. So I would uninstall all that is listed in the Network drivers in the Device Manager, restart the Notebook. Here is a list of Device Manager options, this might help.
    Here is a link to the HP Support Assistant if you need it. Just download and run the application and it will help with the software and drivers on your system that need updating or reinstalling. Hope this helps. Thanks.

  • Multi Screen on Windows without virtual device

    Hello
    I'm developing for a project where I have one screen to display a user interactive java application and a second screen in full screen mode to show a panel with status information. The second screen should not be accessible with the mouse.
    On Windows XP I only see the possibility to make one * virtual* device out of the two monitors. This has the siede effect that the mouse cursor can dissapear on the second monitor, what is not desirable in my application.
    Is it possible with Windows to drive from a Java application several monitors, each having its proper coordinate system (so that GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices() gives several devices) ?
    Thanks for every hint.
    Yves

    Is it possible with Windows to drive from a Java
    application several monitors, each having its proper
    coordinate system (so that
    GraphicsEnvironment.getLocalGraphicsEnvironment().getS
    creenDevices() gives several devices) ?Is it possible to do what you ask with only Java -- NO. You are going to have to do some JNI and C for that low level hardware interface and driver programming.

  • MAX virtual device error

    Hi,
    I've managed to create a corrupted virtual device in Switch Executive. I think I did this trying to save a virtual device to a network drive using Max 4.0 (I now realise after reading this forum that this bug/feature is fixed in Max 4.1). Reading through the forum it appears several others have done the same thing.
    However, the question still unanswered is..... how do we delete a corrupted virtual device in Switch Executive??? Trying to delete the virtual device using the normal menus simply raises an exception in Labview.
    Do we simply create a blank mxs file (found in ProgramFiles/National Instruments/Max/Data/) or is there an application that can regenerate this file? Note that I've saved my desired configuration to a local drive successfully, so can afford to completely erase all the current virtual devices.
    Regards,
    Tom

    Hi Tom,
    As you already know, this issue appeared with MAX 4.0 and it is fixed with MAX 4.1. The previous workaround was to export your configuration locally and copy it manually to the network location.
    It is possible that the crash might have permanently corrupted your mxs file system stored in the data folder. To restore a clean data folder follow the steps below: FOLLOWING THESE STEPS WILL DELETE EVERY CONFIGURED ITEM IN MAX (NISE CONFIGURATIONS, DAQMX TASKS, VIRTUAL CHANNELS). Excel needs to be installed to use this procedure.
    1. Export the configuration to Excel using the NISE Excel example GenerateExcelReport.xls (Program Files\National Instruments\Switch Executive\Examples\Excel)
    2. In the command prompt type (with MAX closed) : net stop mxssvr
    3. Delete the MAX Data directory (Program Files\National Instruments\MAX\Data)
    4. Reboot your computer
    5. Import your xls file created in the first step using the example: ImportFromExcel.xls
    Note: You may get an "Invalid resource name" error when you attempt to import your xls file. This will occur if Hardware Assets do not match DAQmx device names. Deleting the MAX Data directory forces your system to redetect all your DAQmx devices. All the devices will be reverted to default names, usually PXI_Slot_ or Dev_. If the Hardware Asset for any device differs from it's DAQmx name, simply right-click on the device under NI-DAQmx Devices to Rename it so they are the same.
    The following two steps will allow you to export the configuration to a network drive.
    6. Export the configuration to your local drive by right clicking on the configuration
    7. Copy the exported NISE configuration from your local drive to your network drive
    Let me know if you have further questions or if this does not resolve your issue!
    Chad Erickson
    Switch Product Support Engineer
    NI - USA

Maybe you are looking for