Email vs FTP Server for Transferring many Small Text Files [closed] - c#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
What are the upsides to using an FTP server (hosted by a third party) to transfer (and maybe store) files when compared to just sending through email? The language of choice is C#.
Email looks easier to implement and if it was going to Gmail then server hosting and upkeep would not be a worry. However, I am not experienced with FTP servers and don't know how big of deal setup and upkeep is on them. All that is being sent is a bunch of text files, most likely each under 1 MB. Security is not a big deal at this point, but I am curious which is more secure without doing a lot of extra setup work.

Emailing means you have no guarantee that the file is received at the other end, or in a timely manner. Maybe this is not important for you? Emailing certainly would be easier to program up compared to FTP.
On the other hand if you use one of the many FTP libraries available for .NET then have complete control. You could include the library in a C# windows service to do the transferring seamlessly for you including exception (error) processing and notification.
Personally I'd take the opportunity to learn about FTP (its easy). You would of course require a FTP service to be setup on your server. All part of the learning.

I don't know your specific use case, but it sound like FTP is more appropriate than email for transferring and storing files. I mean it is called the "File Transfer Protocol" for a reason ;) The upside of FTP over Email is that it is designed for files while email is designed for email messages - it will be more difficult in automating the management of file attachments in email.
Setting up an FTP server is not difficult. Check out FileZilla:
https://filezilla-project.org/download.php?type=server
Sending files via FTP with C# is not difficult either. Here is question on that:
Upload file on ftp
BTW, again without knowing your requirements, there are also cloud services like Dropbox and Box.com that have APIs that might be even more appropriate for you.

Related

How to implement IMAP Protocol (Server side) using C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am trying to write a service that provide user a subdomain as mailbox.
So I need to implement IMAP server on my own.
I notice mimekit/mailkit may help me. (At least they can help me test my server.)
It is possible to implement a minimum IMAP Protocol (server side) using mimekit/mailkit?
I would say that MimeKit would certainly be helpful in that a significant part of writing an IMAP server (or even a POP3 or SMTP server) is that you will at some point need to deal with parsing messages and/or headers and MimeKit is a perfect solution for that.
There are parts of MailKit which might be helpful for implementing an IMAP server. For example, re-using the UniqueId (and related) classes for your IMAP server project would likely be useful. Likewise, if you eventually implement the THREAD extension, the MessageThreader class would be invaluable.
The ImapEncoding class would certainly be reusable.
You might be able to at least partially re-use the ImapStream (and ImapToken) class as your tokenizer for an IMAP server, but I'm not 100% sure on that since I've never looked at it from that perspective and there might be subtle differences there, but you could probably use it as a reasonable starting point.
ImapUtils.FormatInternalDate() would be a good candidate for re-use...
You might be able to reuse a lot of the FolderQuota and AccessControl classes as well if you end up supporting the QUOTA and/or ACL IMAP extensions (not that those classes do much).
I'm sure there are various other bits & pieces that would be helpful to re-use from MailKit, but you won't be able to easily turn the ImapClient class into an ImapServer class, for example.
And then, of course, as you mentioned in your post, you could always use MailKit as a great way of testing your IMAP server implementation to make sure things work.
Hope that helps answer your question.
Is it possible to implement a minimum IMAP Server using mimekit/mailkit?
Short answer: No!
The main goal of this project is to provide the .NET world with
robust, fully featured and RFC-compliant SMTP, POP3, and IMAP client
implementations.
You should beware of the huge difference between a mail server (which keeps your emails, is visible to the outside world and normally is 24/7 live) and a mail client which is mainly used to fetch the mails from that sever.

Send & Receive methods to be used in .Net app via an server [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
After wasting over a month looking and reading about .Net Protections, I have convinced that there is no way to 100% protect .Net from decompiling ,even if there it won't last a lot.
However i though about rebuilding my app remotely to a server built in c# too.
My questions is:
1-is it possible to send methods to my app to be used there? (That shouldn't be a full method transfer).
2-Best practice for socket multi-threading to handle data from each client on my server.
Generally speaking, if you want to keep your compiled C# code from being decompiled, don't make the compiled bytecode available to anyone. You seem to sense that this will require a client-server system, and that's correct. You also want a "thin client," meaning that the client shouldn't contain any of your application's business logic but rely on the server for everything but user input and presentation of data. You could do this with a custom C# client or something written in HTML and JavaScript that would run within a web browser. (If you go with a web application, make sure you don't include any business logic in your JavaScript, because that will be sent to the browser in plain text.)
As for the idea of sending executable bytecode to the client from the server, that seems less secure than a web app. Even if you encrypt communication between the client and server, the client will still end up with executable bytecode that could be decompiled on the client side.
Before you start implementing the communications protocol yourself, do take a look at WCF. If both your client and server are .NET based, WCF is the easiest way to go.

Recommendations for most secure real time data transfer [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have been asked to develop a system that collects data from a Sql Server database and send that data in "some" format to a client as real-time as possible. The data is basic contact forms from a .net website. Names, phone numbers, email. No SSN type data.
The only parameters I know about the project are:
The client will probably want multiple ways to consume to data.
Excel, Rss readers, lead management systems, etc.
The client has
expressed zero concern for security.
I am not going to just ignore
security because the client doesn't care.
Full Disclosure: I am NOT a security expert.
I want to use some type of secure rss/xml feed because that would seem to offer the most options for the client to consume and it would be as real time as possible. However, many of the posts on this topic here at SO seem to suggest even with basic authentication and SSL, you are asking for trouble.
I could setup up a secure FTP download, but this doesn't seem to make sense as it would require the client to constantly check for incoming contact forms/leads.
If all else fails I could just email CSV files every 2 or 3 minutes but this does not seem very good either.
I guess my main question is: Is there another way I am missing or is a secure Rss/Xml feed OK for this application?
Thanks.
IF the client is known then you can secure this rather good with SSL.
Use SSL not only on the server side but on the client-side too by requiring the clients identify themselves with a certificate... that certificate is installed once on the machine of the client/boss/whoever and made known to your server.
For some information on how to do this with IIS see:
http://support.microsoft.com/kb/315588/en-us
read client certificate from httprequest C#
http://www.iis.net/ConfigReference/system.webServer/security/authentication/iisClientCertificateMappingAuthentication

C# P2P Instant Messenger General Basis Help [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want to start a simple windows P2P instant messenger in C#, similar to AOL, ICQ, etc, but much more simple (plain text messages between 2 guys)
I don't need examples on how to do it. I can find them myself.
What I do need is a general idea of how instant messaging works (P2P, not multichat) without many technical details.
For example:
Will I need a main server to make the communication between user1 and user2 happen or user1 can send the strings directly to user2? How is this called?
If user1 is logged in, how does he know of an incoming message from another user (or the online status of their friends)? Does the chat client app check every X seconds with a main server?
Any clues that might help me clear the general data flow idea will be very much appreciated.
A flowchart may also be helpful if you find one to share.
Thanks in advance.
UPDATE (NEW QUESTION) - July 6
Let's say the user had successfully logged in, and the app needs now to get and populate the list of contacts (saved on my apache/php/mysql server).
How would you implement the data retrieval (important) and later population of the contacts list? Is WebClient.DownloadString[Async] a good approach? Is there a better way?
How often should the app check for updated list (online/offline statuses). Recommendations accepted.
How can I parse JSON data on C#.NET (Visual C# Studio 2010)
I will get JSON strings.
Thanks!
If you really want to build a p2p app, there should be no server. However, this is not straightforward.
There are lots of different approaches to creating a chat system, mostly involving servers. Research comet (a good solution if implemented properly, terrible otherwise), polling (checking every x seconds) or using sockets, however there are lots of issues to be considered - and caveats, particularly firewalls/nat routers. A socket solution could potentially be 'p2p', but the polling and comet ones are not.
For your use case, I would go with a simple socket solution (one side as server, one as client) and configure your router firewall by opening a port at the server end.
You could extend this so that both sides could be both servers (listening on a port) and clients, so you could both 'call' each other.
You will need to have a permanent ip, or use a service like dyndns to get this to work properly.
Update
Yes, DownloadString or DownloadStringAsync would be a fine method.
How often is really up to you. I assume that this is only for a few users from what you said in the question, so you don't need to worry about overloading the server. Once a minute sounds reasonable, but once a second would proabably be fine too if you feel that way inclined... Parsing JSON in .NET answers your final query.

Peer to Peer file transfer c# [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Hey, I have been looking on google and I cannot seem to find anything about peer to peer transfer.
Basically, I want to be able to send a file from my computer to someone else's computer. Does anyone know of any guides that can help me with this?
Thanks.
Google "System.Net.PeerToPeer", a namespace available in the .NET 3.5 framework. You'll have no trouble finding docs and sample code.
If you really just want to "send a file from my computer to someone else's computer" using C# then you may not be looking for true p2p. You can just use raw TCP. For this you need the remote computer to listen for a connection, your computer to open a connection to the remote computer, and start sending data.
There's a very basic example on how to do something like that here.
If you are actually looking for true P2P then you're best off using an existing P2P network (otherwise there will be nobody but you and your other computer on it). There are a few C# BitTorrent libraries around - for example BitSharp, TorrentNet. There is a whole question about BitTorrent libraries written in pure C#.
If the destination computer is able to expose a URI to publish to then you can simply use
WebClient.UploadFile(Uri address, string filename)
It very simply just takes a URI as address (http, ftp, even the file protocol to transfer to a folder share).
But that does require setting up something server side to publish to, but it would be platform independent on the server (e.g. any old FTP server, or a web page or service that accepts a file by POST method). Security may be an issue you need to consider however.
That's using a push model. WebClient can also be used from the other side to download. It also supports transfer of data streams, strings, etc.
Have a look at this project on Code Project.
It provides for P2P chat and file transfer and could be either an inspiration or a solution.

Categories