I am creating a Windows Phone App using VB.NET and what I want to do is have the user fill out a form within the app, and then when they press a send button I need to app to write these details to a text file, so I can then attach this to an email.
However the problem is I have no idea how to successfully write these details to a text file, I was wondering if anybody had an example of how it is done or just some advice that may help me to find what path I need to take in order to resolve this?
Thank you
The simplest way to send an email on Windows Phone is via the EmailComposeTask API.
Sample VB.NET code from MSDN:
Dim emailComposeTask as EmailComposeTask= new EmailComposeTask()
emailComposeTask.Subject = "message subject"
emailComposeTask.Body = "message body"
emailComposeTask.To = "recipient#example.com"
emailComposeTask.Cc = "cc#example.com"
emailComposeTask.Bcc = "bcc#example.com"
emailComposeTask.Show()
The downside of this API is that it doesn't allow attaching files.
So if you have the requirement to send the email with an attachment, you'll have to rely on an external service.
Here is the code for creating a text file in a MemoryStream:
Dim memoryStrm As New MemoryStream()
Dim writer As New StreamWriter(memoryStrm)
writer.WriteLine("Line 1")
writer.WriteLine("Line 2")
You could send this file to a web service that will in turn send the email.
Related
For Office 365 Outlook Web App, we would like to convert attachments to links once end user uploads them, however we didn't see an attachment notification event at current Outlook Addin.
Another approach we could do is to ask them to use our own buttons for uploading, however we need to guide end user to use our own buttons, could we add some message at top of email body like below once new email message box is displayed?
Somehow based on our research, Outlook Addin only has one event right now which is SendEvent, could someone confirm this? if so, it is rather limited.
To display a custom message use Office.context.mailbox.item.notificationMessages object. For example to add a message to current item the code may looks like ...
Office.context.mailbox.item.notificationMessages.addAsync("information", {
type: "informationalMessage",
message : "My custom message.",
icon : "iconid",
persistent: false
});
Be aware there are a maximum of 5 notifications per message and maximum length of each message text is 150 characters per Office.NotificationMessageDetails interface.
For the secondary question you would need to look at available events in Office.EventType enum. Over here you'll see few events available to Outlook app. One of them you are interested in is AttachmentsChanged which is currently available only in Preview (not released yet, but will be soon).
I wanted to ask ...I want to make a program in visual basic (2015) that it will receive an email (outlook,hotmail,gmail) with an attachment (picture) and open it in a picturebox.
Is this possible?
If yes can anyone help me with the code?
Appreciate
Short answer, you'll probably need to use a Pop3 client.
See here: Download attachment from email
Once you have the email attachments downloaded locally, loading them into a picturebox is pretty straightforward.
PictureBox1.Image = new Bitmap( {pathToDownloadedImage} );
I've heard much about you guys, I'm about to finish my application but I need to finish my login system.
I've created a notepad & uploaded it to the server with the following examples:
Username:TestUser1
Password:TestPass1
License:28/06/2013
Username:TestUser2
Password:TestPass2
License:30/06/2013
I already made a login form with a Textbox1, Textbox2 & a Button.
Textbox1 = InputUser
Textbox2 = InputPass
Button1 = Login
I want that if the button is pressed it checks the username & password matches then login with a messagebox which says: "your license is valid until: " & License.
Also, I want that every username got a password, so other users can't use other's passwords.
How can I write this code in VB.net 2010?
Thanks in advance.
Does it bother you that it takes 10 minutes to crack an authentication system like this? Not only that, but all your users and passwords will be visible to the public for anyone who knows the address (which is easy to find using just a packet analyzer).
If the answer is still no, take a look at how to use WebRequest and WebResponse to retrieve your text file: http://msdn.microsoft.com/en-us/library/456dfw4f.aspx.
PS: stackoverflow is here to solve problems in your existing code, not to write the code for you.
Someone have this for you ...
Do that with HttpWebRequest and its GetResponse method, which gives you a WebResponse on which you can call GetResponseStream to get a Stream object to pass to your StreamReader.
I am trying to build an application using VB .Net that will automatically log into ADP so that I can automatically download a time card report. I tried to show an image, but because I am new I am unable. You can view the form by going to https://portal.adp.com/public/index.htm and clicking User Login. Can someone tell me how to populate the User name and Password text boxes? I have spent a lot of time searching, but haven't been unable to find any information on this. Any help is greatly appreciated.
If you are using a WebClient to interact with the site, you can simply use the Credentials property because this is a standard HTTP-login.
Dim client As New WebClient()
client.Credentials = new NetworkCredential("username", "password")
Dim pageData As String = client.DownloadString("https://portal.adp.com/wps/employee/employee.jsp")
Here more information about the NetworkCredential class. Also you can take a look at this. If you are using a WebBrowser control, you can use this method.
You can create an Internet Explorer add-in, and use that to fill in the form and login. Here is a tutorial I found.
http://www.add-in-express.com/creating-addins-blog/2012/07/09/create-addons-ie10/
I am trying to do a file upload from gwt-ext without bringing up the dialog box. To do this, I created a FormPanel and added the appropriate fields to it. Then did a form.submit(). This doesn't seem to work. Any idea why? The code is shown below.
final FormPanel uploadForm = new FormPanel();
uploadForm.setVisible(false);
uploadForm.setFileUpload(true);
final TextField sourceFile = new TextField("File", "sourceFile");
sourceFile.setVisible(false);
sourceFile.setInputType("file");
sourceFile.setValue("/tmp/test.txt");
final TextField targetFile = new TextField("Upload As", "targetFile");
targetFile.setVisible(false);
targetFile.setValue("different.txt");
uploadForm.add(sourceFile);
uploadForm.add(targetFile);
final String url = GWT.getModuleBaseURL() + "/uploadFile";
uploadForm.getForm().submit(url, null, Connection.POST, null, false);
I tested the servlet on the server side with a simple html form and it works correctly. Only the GWT-EXT version doesn't seem to work.
I found out why the above piece of code is not working. The primary issue here is that file uploads are blocked by the browser due to security reasons if the upload form has not been rendered and/or if the form has been modified after the user clicks the submit button. If the browser did allow such things, then any file on the system can be easily uploaded without the user's knowledge.
Solution to to the above problem is to bring up the dialog box, do the upload in the event handler for the submit button and in the onActionComplete method of the form listener, do any other processing.
The whole idea of uploading without dialog box looks like a security breach to me. I can imagine an application that steals passwords file whenever opened, if only the above would be possible.