Ms access 2010 how to open MSpaint with a blank page using the form name as a file name? - ms-access-2010

I made a program to create Jobs field Tickets, and i want to add a option in the same form that open MSPaint or other program in a blank page using the ticket number as a file name, so, whoever is creating the Ticket can hand draw anything.

Create an empty template image file with appropriate dimensions and file type at a constant path
use FileCopy to copy it to your desired path & file name
use Shell to launch a mspaint.exe command-line with your file name as parameter.

Related

How to Set a File's Blob Filename?

In a Plone's File content type, which property stores the file's original filename?
I'm using plone.jsonapi.routes to upload files to a plone instance. I can set the id ant the title but I can't set the associated file's filename.
For example, when I upload a file to Plone in the regular way, I can set its id and title, but additionally to that, the original file name is stored somewhere. You can see it here:
objects-essay.pdf - PDF document indicates the name the original file has.
But when I upload it with plone.jsonapi.routes that field is empty. So, I'm trying to figure it out which property stores the name to pass it to the api or to set it by hand.
Thanks.
IIRC, all Archetypes-based content types have a setFilename method that you can use to do this.
On Dexterity-based content types file's content is stored in blobs in the ZODB (instances of NamedBlobFile) and there's a parameter named filename that you can use to set it.
You can see an example of the later in plone.app.contenttypes.

How to set localization in asp.net?

How can I set localization in asp.net?
I need to display in Arabic instead of English.
Asp.net in multilingual so using localisation I did.But adding .resx not getting result.
Anybody tell me Step by step procedure.
This page can show you step by step ,
Using Resources for Localization with ASP.NET !
"Solution Explorer"
right-click the root of your Web site
Add "ASP.NET Folder"
click "App_GlobalResources"
Right-click the "App_GlobalResources folder"
"Add New Item"
In the list, click "Resource File"
In the Name box, type "LocalizedText.resx"
click "Add"
The "LocalizedText.resx" file (acts as the resource for the fallback culture)
Create a second .resx file
name it "LocalizedText.fr.resx"(The string "fr" identifies the file as the resource to use if the browser's language is set to French)
Create a third .resx file
name it "LocalizedText.es-mx.resx"(The string "es-mx" identifies the file as file as the resource to use if the browser's language is set to Spanish (Mexico))
Open the "LocalizedText.resx" file.
In the first row under the Name column type "Msg1".
In the first row under the Value column, type "Hello"
Save the file and close it --> Open the "LocalizedText.fr.resx"
create a resource string named "Msg1" --> assign it the value "Bon jour"
Now 1st file is done --> save and close the file
Open the "LocalizedText.es-mx.resx"
create a resource string named "Msg1"
assign it the value "Buenos días".
Now 2nd file is done
save and close the file.

xml file back up?

I have a asp.net application which reads and updates and xml file in my file system.I do have the options edit and save.As of now it serves my purpose but what if the user edits the values and saves but for some reason he wants to restore the old values to the xml file.I want to
have an option called reset which will get the old values of the xml file incase the user wants to get back to the default values.How do i create a back up to the original file and how do i call that xml file ??? Can any one suggest whether i am in right path or not?
I am using Linq-to xml here .
Keep a copy of the original XML file. Call it xml_file.bk and when the user clicks "reset" delete the current XML file and make a copy of XML_File.bk to the real name with the .xml extension.
You can use File.Move(sourcefile, destinationFile) to make a copy of the original.
File.Move documentation.

Get file upload data from post data in ASP.NET

I am looping through the posted values on a form with a view to doing something with them (so don't have access to the controls themselves). This is the process I have to take on this project so that is why I'm doing it this way.
On the form I will have a file upload box but I am not sure how I would upload the file that has been selected from it as I can't just do Control.SaveAs(). When I return the posted value using Request.Form.Item[i] I get the file name I chose but not the full path like I would expect.
Can someone point me in the right direction please?
Thanks.
If you want to manipulate the uploaded files directly, and not through a FileUploader control, you should use the Request.Files collection and not the Request.Form
File Upload controls only pass the file name and the contents. I'm not sure why you would need a folder name, especially since the folder name would be for the client - I can't expect that this would have any value to you since you want to save the file on the server.
As I am unsure of your goals, I would recommend using Server.MapPath("~/Folder") to find a suitable folder to save your uploaded files to

Asp.net creating tab delimited txt file

I have to create a tab delimited txt file from a query.
I want to call an HttpHandler that returns my txt file as a stream, I don't want to create the file phisically.
1st question:
what is the best practice to create the tab delimited txt file from a query result?
I have to fetch all rows and create the file manually?
2nd question:
How to set a timeout for the HttpHandler that creates the file?
Thanks for your time.
I would create a plain old http output stream and change the content type to 'text/plain' which means that you don't need to physically create the file on the web server, and if you add the content-disposition header to the output and specify that it has an attachment called something like 'report.txt' the user will be prompted to Open or Save the content, rather than just viewing it in the browser like a normal web page.
You can use the Server.ScriptTimeout = x to set the script timeout by gaining access to the current HttpContext object
Hope this helps

Resources