website/webservice to fetch data from pc - asp.net

Is it possible to have a webapp/webservice to fetch data from my pc?? Can anyone give me an idea if it is possible....

This will depend on how this data is going to be exposed from your PC. If you want to read some files from the file system, the server hosting the web application will need to have access to those files. For example you could create a network share and read from this share: byte[] data = File.ReadAllBytes("\\yourpc\somefile.dat");

yes, you can have your localhost server too. install wamp, or xampp server, create your php script that gives you data, which can used in you mobile application.

Related

QSQLDatabase (using SQLite) takes long time to open a database

I have developed an application win QT which uses SQLIte database. The copy of database is located on each site.
On one site let's say site 'BOB1' it works perfectly without any problem. But when we try to use it on another site lets say 'BOB2' it takes long time to open a database connection(approx 2000 milliseconds).
I thought that perhaps there is a network problem, So they tried to use the server of the site 'BOB1' as their server, which works fine. But when i tried to use the server of the site 'BOB2' from the site 'BOB1', I have the same problem. So i thought it may not be the network issue.
Another thing that came to my mind was that, perhaps there is a problem of DNS resolution. But when i tried to ping the server using IP and hostname, the response time is the same.
Any idea or pointer that what can be the problem.
PS: Server + database file path is specified in the setDatabasePath() fuinction using enviornment variables.
Consider copying the database to the local machine (eg temp folder if transient, or other suitable location if permanent). You can safely use either file copy, or consider using the qt backup API to ensure that the transfer happens successfully (plus you get the option of progress feedback)
https://sqlite.org/backup.html
You could even "backup" the file from the remote server to in-memory if the file is small and you say you're reading only?
You can see some sample code here on how to import an sqlite DB into a Qt QSqlDatabase. Note that when you do this, you want to make sure the version of sqlite native API that you're using is the same as that compiled into Qt, or you may get error messages from sqlite or Qt.

Export Sitebuilder SQL Server database to Excel | CSV | MySQL

I need to migrate a customer's site which happens to be hosted in a remote Win32 environment with Sitebuilder, Plesk, SQL Server and ASP or ASP.Net, I'm not sure.
I'm used to LAMP environments, so I don't know what to do with all the files in this server. Sitebuilder and SQL Server are also new to me.
I only have access to the FTP files and to the Plesk panel control, but it doesn't even acknowledge the existence of any SQL Server database (as it usually does with MySQL databases).
So far I've only been able to think of these two options:
Code an ASP script that writes down the database content into CSV files (wouldn't know where to start).
Code a script that retrieves the data directly from the HTML pages (long, painful, error prone and not useful to access data available only to logged in users).
So my question is: from your experience, knowledge of this platform, and point of view, which would be my best option?
Thank you very much in advance in my first question here. Regards,
UPDATE: I've managed to access the server (Windows 2008 server + SQL server 2008) using remote desktop. I guess I should be able to export the database now. I'll check Management Studio to see if it can help in the process.
It sounds odd that it doesn't support remote connections, but if you want to do it from within your asp-pages, the following links might be good starting points:
Want to script all objects which depend on a SQL Server table
http://www.dotnetfunda.com/codes/code32-how-to-generate-create-table-script-for-all-tables-in-sql-server-database.aspx
https://dba.stackexchange.com/questions/20355/generate-create-script-for-all-indexes

Run a Virus Scan While Uploading files in ASP.NET

I have developed a web based application in ASP.NET and C# where users have the facility to upload files on the server through this application I want the application to Scan the uploaded files for viruses before saving on the server. Same like when we attach files with our email in Yahoo. Please guide me how I can achieve this functionality Any API which can be integrated in ASP.NET application or any other way you can suggest. We can purchase the licensed version of a product which can achieve this. I have googled but did not find specific results.
Thanks in advance!
First of all the file must be saved onto the server before you can scan it. If you notice Yahoo will upload the file first - but not allow the attachment to be sent until scanned.
Then you can use an antivirus with a command line interface or some other kind of API. Both of these can be called via C# and should provide the functionality you require. Parhaps write a wrapper class that takes a file and returns true or false depending on whether a virus was detected.
Other applications that provide you with a command line interface:
Microsoft Security Essentials
clamAv
I believe MS AV provides better results.
Just purchase antivirus software that has a command-line interface (several popular packages include this). Once the file has been uploaded, run the scan.
I would think, in order to upload and scan at the same time, you might need to implement your own antivirus software as I'm not familiar with any package that would provide that sort of interface.
I run a shareware site. It doesn't work as you described, but I download each file to my local computer and run a scan on them. You would be doing something similar.

Drupal: remote development with Eclipse

What's the best solution to develop Drupal remotely on a development server, using Eclipse ?
I found this: http://www.eclipse.org/dsdp/tm/
Is this the best way to do it ? And above all, am I going to have some limitations ?
thanks
Sometimes SSH / SFTP is a better solution than Samba. SSH is likely to be activated on most servers an can be mounted into the local file system.
If you only have access via FTP you have two options.
You can set up a connection to the server using remove system explorer. When you set up a new project use the generic new project option and there you should have an option to choose which file system to use.
This will mean that you work directly on the server, be warned this can be slow sometimes, using FTP is slower than most other methods of connecting to a remote system.
The other option is to work locally and deploy to your server when you whish to test something. You can use the 'export' feature for this.
Just use samba on the machine. Point your project at it.

Remote File Read

How can I read a text file resides in a remote machine? There is no share exists in that machine and I am not allowed to create any share or file in the remote machine. Also I am not allowed to run any client program in the remote machine. My program is a ASP.net in C# residing in a IIS webserver. For linux machine we used ssh connections and file reads are easy. Is there something by default available in windows similiar to it ?
Thanks,
Sreejith
The first question to ask is if there's a good business reason to read that file. If yes, the IT people will have to allow you a reasonable solution to the problem.
I have frequently used SFTP (secure FTP) for this kind of problem. Unfortunately SFTP is not part of Windows, but there are free and low-cost SFTP servers available. Here's a list from Wikipedia
Explain to IT why you need access to that file and discuss options including SFTP. If you have a valid business reason for this and they will "not let you because of policy", it's the job of your project manager or boss to clear out that roadblock. Ask them to help.
Finally, consider whether it's practical for the file on the remote machine to be pushed to you instead of you pulling it. If you can setup a file share on your PC, ask them to setup a job on the remote server that copies the file to your file share every time it is changed.
You could try accessing the Admin share of the machine. Windows by default created a share for all disks (named C$, D$ etc). But in that case the application you write should be running with the credentials of a user with rights to that share ((local) administrators have sufficient rights to do that).
If that doesn't work you need to create a share or install software to get files from that machine (like FTP). This is all because of security, it's a good thing you are not able to just read a file from any machine...
I have done this many time with the Remote File port 34
http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

Resources