I’ve made desktop app, and i want it to work also as an web app.
I get errors on lines with File() type and FileStream, is there any way to bypass this ?
I’ve made desktop app, and i want it to work also as an web
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To piggyback on @Florian F’s correct response, here is how you might implement it:
Create an interface to abstract your file access
Create a file-based implementation
And an HTTP-based implementation
In your consumer, rely on the IGetTheStuffService
Notice the Inject meta tag. This is where your Dependency Injection (DI) system would push in your dependency based on the configuration (FileStuffService for Air apps or HTTPStuffService for Web apps). Parsley and RobotLegs use [Inject] where fiex-ioc uses [IocBind]
Of course, you could go without a DI container… you would just inject the parameter directly.
But you get the idea… a pretty simple pattern, actually.