|
Thanks for reply,
But what I asked for is using code will be more better than using standard tools ? and if yes how achieve this ?
Thank you
|
|
|
|
|
If you have to ask, then it is better to use standard tools.
Recreate the database-tables in SQL Server and see if you can export the data as CSV or similar.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I would use the standard tool UNLESS it is something that needed repeating regularly. For a one off migration do it manually.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
can anyone point me to best open source xamarin apps for learning?
cheers
=====================================================
The grass is always greener on the other side of the fence
|
|
|
|
|
For learning what? Xamarin Forms? Xamarin Android? Xamarin iOS?
This space for rent
|
|
|
|
|
The Xamarin website.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
For learning xamarin forms and xamarin android
=====================================================
The grass is always greener on the other side of the fence
|
|
|
|
|
Why not start with the Xamarin documentation? The examples and documentation are very good.
This space for rent
|
|
|
|
|
I know why I am having the problem but I need a solution/workaround.
I have a c# program that generates excel output and saves it as an html file in the user's document folder. This automatically generates the [excel_file_name]_files subfolderwhich is used to store specific info used by the html file. The program ALSO auto-generates jpg images every time it is run based on historic data that is taken from the spreadsheet each time it is run and saves those images in this sub-folder. The program needs to be able to delete the files it creates within this folder but of course the user's folder makes sure to keep programs from simply deleting arbitrary files within the user's folder so that prevents me from deleting them as I do not have permission to delete a users files.
Is it possible for me to programmatically grant the application OS permissions to delete/change files it creates within a user's subfolder? Or will the user need to run the program with admin rights each time (if they can even get such rights).?
|
|
|
|
|
|
Did you read my post? I already specified that. Specifically the program saves an Excel file "as an html file in the user's document folder. This automatically generates the [excel_file_name]_files subfolder... The program ALSO auto-generates jpg images every time... and saves those images in this sub-folder."
If that is too confusing, it is a subfolder of %USERPROFILE%\Documents created by Excel. This is BEFORE the application exports any excel files to html so the folder is not in use... and my application checks to make sure the folder exists before attempting any file operations; just in case the user has not ever used the program before.
|
|
|
|
|
I read your post.
Your concept of the "user's document folder" could have no basis in reality.
That's is why we use "enumerations" to insure we use something "familiar" to the OS.
Got it?
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Regardless, the enumeration resolves to a location determined by the .NET implementation for the specific OS. I am using the enumeration by default so whatever that returns is what I am using. The user has the option to change this but it doesn't matter in context as user specific considerations would not be an issue in a custom folder unless those permissions are altered to something other than the default (which is beyond my control).
|
|
|
|
|
I asked a simple question; that was all.
If you think you provided all the "facts" needed to provide an "informed response", then we disagree.
I don't know you from Adam; and if I assumed everyone always knew what they were talking about, I would be dead a couple of times over by now; or sued.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
This doesn't make sense. Any code launched by the user runs AS THE USER. The user will have full access, including delete permissions, to anything under their profile, including the Documents folder.
The code will be executing as the user as it will inherit the users seecurity token on launch. SO, if the user has permissions to delete files, the code will to.
Code cannot grant itself more permissions than it already has. The user can't do that, so the code won't be able to do it either.
What type of app is this? What account is the app running under? Does the user launch this app?
|
|
|
|
|
It is an app run by the user that ls logged in. IT seems to be working now but it crashed previously. From my experience, applications have their own permission sets. Are you saying this is not the case? I have had several experiences that would suggest otherwise; the latest being that on Windows 10 a downloaded Excel document opened by the user in excel will allow itself to be read because I have overridden the default behavior. However, if the user launches my application to do the same thing, it will crash with a COM error that appears to be related to the fact that downloaded files are not allowed to be read under the current permissions. This is unique to Windows 10 as it does not happen under Windows 7. I had to import a non-COM Excel reader when I ported to Windows 10 in order to get it to read excel files without crashing (or without me personally opening the files myself in debug mode).
|
|
|
|
|
primem0ver wrote: From my experience, applications have their own permission sets. Are you saying this is not the case?
Correct. Applications ALWAYS run as the user the launched them, inheriting the security token (permissions) of the user. There is no way to get around this.
Applications also cannot grant themselves permissions over and above what they inherited from launch. That was be a massive security risk. Windows, and every other O/S with security built into it, simply does not allow that to happen.
The sole exception of this is when running under Vista and above, an administrator user account can be split into two security contexts, the normal user version of the account and the administrator version. Normally, everything runs as the normal user account, unless admin permissions are required. That's when User Account Control comes in and asks if you really want to run something as an administrator, or if you explicitly launch the process "as administrator".
You've got a different problem with your code.
It's not permissions.
|
|
|
|
|
Ok. I am following you. I realize that permissions inherited from the user make sense. However, having an application run with fewer permissions than the user is not a safety hazard in terms of security and my experience is that this can happen.
Another example (which is incidentally timely, and appropriate for this thread) is that permissions are an issue with certain virtual system accounts on which older versions of this program run. (The creation and deleting of jpgs is a new, unreleased, feature). I have isolated the old issue to something in the way permissions are granted to newer versus older users. The following code causes the application to crash for newer users only. The folder being searched (directoryInfo) is the Downloads folder for the user:
FileInfo[] fileInfos = directoryInfo.GetFiles("GeniusExport*.*", SearchOption.TopDirectoryOnly);
For all users, the user profile directory is a mapped drive. Perhaps directoryInfo resolves to something non-existent for newer users and perhaps I should test that; however this is a Windows 10 environment. I know for a fact that the people I have worked with who have this problem have a Downloads folder that is being used.
|
|
|
|
|
This isn't a permissions problem in the normal sense. That little line of code works on every machine and VM I have, under every account I normally use.
This is something unique to your environment. Perhaps a problem caused by antivirus or some other security software software.
I'm working with large antivirus vendor right now on a problem that causes Excel to crash on first start after a certain app is installed, which is just a add-in for Excel. Disabling the antivirus doesn't fix the problem. Stopping every single process in the antivirus or uninstalling it completely fixes the problem.
|
|
|
|
|
I have a "user files" implementation in C# / WPF that been running from XP through to W10, and EVERYTHING in between ... (including Windows 7 VM's; Hyper-V and VMBox)
Fixed disk, memory card; USB stick.
"Local" database files; created and deleted.
Multi-threaded mirroring. Blah, blah.
Automatically elevates for creating directories.
(Uses "Special" folders enumerations).
I agree; it's not "security".
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
This seems to be the cause of my problem as well. I close the antivirus software and it works fine. Wow. How are you dealing with this?
|
|
|
|
|
In your case, it's probably going to be as simple as adding an exception for your app in the antivirus policies, if that's supported.
For me, it's a ticket open with the antivirus vendor for the last month and a metric sh*t ton of troubleshooting.
|
|
|
|
|
I have an List saved in my user settings, it should save several strings, but when I check its value (by Settings.Default.FileList.Count) it displays that the value is 0, when I save a string, it displays the number of strings saved, but when I Change of form or I restart the app, it's again 0.
I've already tried using Save(); method, and even, the Upgrade(); method but it stills.
|
|
|
|
|
I can only guess that you are doing something wrong.
|
|
|
|
|
You seriously expect someone to be able to tell you what's wrong when you don't show us the code you're using the define and populate this list, the code to save the list in Settings, where you're saving the settings, nor any exception messages?
|
|
|
|