Options For Sending A File?
Mar 5, 2010[code]...
Im not talking about a database...Just a way to send files from one computer to another.
[code]...
Im not talking about a database...Just a way to send files from one computer to another.
I am in need of a form that shows various options, exactly like the Options in Visual Studio. Since there are so many options I too want them categorized, with a TreeView to the left taking care of showing the right category.The usual 'easy' approach here would be to just place a TreeView control on the form, add some nodes, and give those nodes a tag or key that corresponds to a panel or UserControl with the options for that category.Since there will be a lot of options however, this is not really feasible design-wise; the form would be cluttered with possibly 50 panels, all of which I would need to select and bring to front from time to time to add controls to them that represent the options.
So I decided to create a custom control that does exactly that. The control is very similar to my Wizard usercontrol, users can add OptionsPanels at design time, which inherit Panel and simply represent one panel of options. When they do, the panel is added to a container panel, and at the same time a TreeNode is added to a TreeView. The control uses a custom ControlDesigner to handle design-time clicks in the Treeview, selecting a different node would select and bring to front the corresponding panel, allowing the user to add the controls he wants.
Due to the design time support the problem of having 50 panels is no longer present, only one panel will be visible at a time and selecting the right panel is as simple as selecting the corresponding TreeNode, just as during run-time. Anyway, I got all this working, but only for a single 'level' of categories. As you can see in the Visual Studio options, there can be multiple levels of categories. For example, the Environment node has a bunch of children, where each child represents one 'options panel'. There can even be deeper nesting, see the Text Editor node for example.Let me begin by drawing out the basics of how my control works so far.
The main control is an OptionsView control, which contains a SplitContainer with a TreeView to the left and a OptionsPanelContainer to the right. The OptionsPanelContainer is merely a Panel to which only OptionsPanel controls can be added, and which raises events when this happens, as well as when OptionsPanels are removed from it. An OptionsPanel also inherits Panel, and these are the actual panels the users will see in the control, one for each option category.For now, each OptionsPanel has exactly one corresponding TreeNode (and vice versa). In the Visual Studio options, each 'parent' category usually has a 'General' node as the first child, and the parent and this General node show the same option panel, but I am ignoring that for the moment.
The OptionsView control has a property Panels that returns the ControlCollection (Controls property) of the OptionsPanelContainer (in other words: it returns a collection of OptionsPanels that are in this container panel).
vb.net
<Editor(GetType(Designers.OptionsPanelCollectionEditor), GetType(UITypeEditor))> _ <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _ Public ReadOnly Property Panels As Control.ControlCollection Get Return Me.PanelContainer.Controls End Get End Property
A custom CollectionEditor for this property takes care of the designer: even though the property type is ControlCollection, the CollectionEditor knows it should create instances of the OptionsPanel control instead of just Controls.When it does this, a corresponding TreeNode is also created and its Tag property is set to the OptionsPanel. Vice versa, the Node property of the OptionsPanel is set to the node. Hence the node and panel both know their corresponding object.
vb.net
Public Class OptionsPanelCollectionEditor Inherits System.ComponentModel.Design.CollectionEditor Public Sub New(type As Type) MyBase.New(type) End Sub Protected Overrides Function CreateCollectionItemType() As System.Type
[code]....
So far so good, this all works fine. I can add Panels via the designer and when I do a new TreeNode appears in the TreeView. I can select this node and the panel becomes visible (comes to the front).Now, I am a little stuck. How do I implement child option panels? And more importantly: how do I let the user add child panels?The most logical choice I think is to let each OptionsPanel have a property (ChildPanels or something) that returns the child OptionsPanels for that panel. Once the user selects an OptionsPanel then, he can look in the property grid to find its ChildPanels property and add child panels to that.
There is a problem though: what would this property return? It must return a ControlCollection of some container (this is, I think, a requirement for the designer features to work, otherwise panels are not added to the Form.Designer.vb file). But there is no container. I cannot add them to the OptionsPanel itself, that would make no sense because the parent OptionsPanel has its own set of controls (the options itself...), there cannot be another (fully docked) Panel on top of those obviously.The container of the main OptionsView then? That is not an option either, its Controls collection holds ALL OptionsPanels, not just the children of the selected panel. I cannot 'select' only the right panels either, that would require me to return a new instance of ControlCollection, it would be impossible to return the actual ControlsCollection that holds merely a small selection of its controls.
With the following piece of code
CODE:
The Or keyword is confusing me. So in the above example which variable gets set. Does options = options or does it set RegexOptions.none.
Just wondering if in the net (VB) world only option for file I/O is the Stream reader/writer. In the VB 6 world we had the slow FSO and we had the native file I/O. As far as speed, mostly concerned with writing few lines of data to a file each second, which may continue 24/7 but each day would have a new file. What are the options available in the net world (that is applicable to VB .net 2003) that can give me the best speed performance?
View 2 RepliesI am trying to remove the File Association I created in the Project properties tab 'Publish'/ 'Options'.I have tried deleting all the entries but is won't let me 'OK".Here is a picture of the evil dialogbox.
View 2 RepliesIn the UI of my winForm I ask the user for a user name and password. I store this password as text in the Settings (the .settings file) of my project. The app is a visual Studio Add-in How can I encrypt and decrypt the password before and after I enter it into the Settings file? I don't really need anything fancy. It's just a little in-house app. But I'd like to know all my options
View 3 Repliesit's possible with vb.net code to show or hide extensions for known file types ? this is a folder option for the new windows 7, wich allow the user to show or hide extensions for files.
[Code]...
As i'm learning more and more about developing ive just got my head around creating classes and modules, i started wondering about something to do with configuration of applications where deployment is in a more diverse environment say in a company where different branches dont need access to all parts of a program, so i thought id throw the question out there in a basic sense and get some feedback. so i can go off and do some more reading and learning.
So the scenario in my head is like this.
So we have for arguments sake FrmConfig which is the master configuration form, then we have FrmMain which is the root menu our application general user interfaces with. So here based on what options are checked as enabled in FrmConfig effects what controls (like buttons/menu options) are enabled in FrmMain.
I like to compress the xmldata before the data is provided to the client as an excel file. I am trying to compress and deliver it as a .zip file. its not working Here's my code below. I tried compressing it, converting it to bytes etc etc. The issue with below code is, the XSL transformation is not happening properly and the output excel file is raw xml with some .net exception at the end. (that's what I see on the .xls file that's downloaded at the end) Before I started working on compression my below code was working fine that gives properly formatted excel file from the xml input. the excel file is so nice you can't even tell it was from XML.
[Code]...
I know there are lots of examples here on the forum, but all to difficult to understand.I have a client:
I have a client:
Imports System.Net.Sockets
Imports System.Text
[code].....
I have only finished about sending string via COM.
View 3 RepliesI have an XDocument ready to be sent out via Network stream, what do I need to get it working? I am connected via networkstream and can send regular text, but I don't know how to send an XML Document, I use the networkStream.write() function to send in text.
View 2 RepliesI need to send text from 2 text boxes(TextBox1 & TextBox2) to a .txt file on seperate lines.
View 7 RepliesI am trying to Send an Email with an attachment (using Gmail) but I keep getting errors like "Operation Timed out" or Failure Sending Email". It was working earlier today but I found out that i needed to add Using statement because the email was having a file open that had to be deleted after it was sent but afterwards it doesn't work.
Here's what I have (Portion of it):
Private Sub SendMailOneAttachment(ByVal un As String, ByVal pass As String, Optional ByVal smtp As String = "smtp.gmail.com")
Using oAttach As Net.Mail.Attachment = New Net.Mail.Attachment((Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "\" & My.Computer.Name & "_" & fName & " .zip"))
Dim client As SmtpClient = New SmtpClient(smtp)
[Code] .....
The ports are correct I believe, no firewall up on my PC...
Im new with vb2008 and i wanted to know if i file is in use before sending it via ftp
View 2 RepliesA certificate is required to complete client authentication.I am sending an XML file to a remote server.[code]
View 1 RepliesI have created window service and one window application which is running as notify application in VS2010 using vb.net both are different project.
I want to pop up message in notify application when window service download some file to local system.
means,i want to send message to notify application when ever window service application download file to local system.
I have made a program that makes a text file and then sends it to my msn account using my gmail account. It works fine the first time but the second time it says that the text file is being used by another process?![code]
View 2 RepliesWhich is better for Sending Files/Sending Images/Msg for P2P Chat?
View 1 RepliesI'm making a windows form.Here is my current code:I don't have any idea on how to link the open file dialog with the file that I am going to attach.
Try
With OpenFileDialog1
'OpenFileDialog1
[code].....
I didn't saw much samples about tcp file share. They look similar to what I am using to send string. My question is : Does these codes work with any kind of files? And May I have some hints about how to do it?
View 1 Repliesi am currently using this code to delete folder files.
For Each itm As String In ListBox1.Items
Try
My.Computer.FileSystem.DeleteFile _
[Code]....
what i am having problems with is that if a file is in use, i get a msgbox prompt.. i do not mind it not deleting the file. how can i bypass that msbox to not show??-.trujade.-
I need some help sending the contents of a listbox to an output text file. Is there any code is visual basic that will allow me to do this.
View 13 RepliesI need to send a switches and a filename to a command line application.First I'll need to get a collection of files that can range from 0 to an infinite amount.Then I can start the process with the correct switches. Normally, within the command line application, I would specify the specific filename and send it as an argument to the application.However, I'm not sure how I would do this. The names of the files have to be preceeded by a specific switch. I can't remember the switch right now, but we'll call it [b]-f[/f].[code]So, I need to figure out how to send all or each of the file names as an argument.
View 1 RepliesI've implemented with Visual Basic 10 an application for Net Framework 4 with functionality to send files via e-mail using System.Net.Mail. It works well except when it comes to sending an XML file whose name contains accents. In the latter case the UTF-8 name is not correct, so Widows Mail Life presents him with name consisting of a set of meaningless characters. Furthermore, the content has lost the format of lines and spaces, presented part of MIME type information in the header, so that it is unreadable XML readers. However, with a name without accents is sent successfully.[code]....
View 3 RepliesI am currently working a piece of code which needs to send an attachment in the
email it generates. The attachment is a PDF document. Due to requirements I am
unable to save the PDF and send it, so I have had to create a memory stream attachment.
The issue I have with this is that the file size is _500KB. However save the file on my machine and it is around 370KB.
This increase in file size is unacceptable. has anyone come across this issue before? If so how have they got round the problem.
Below is the section of code.
Dim memStream As System.IO.MemoryStream = Nothing
'assign number to the PDF name
Dim filename As String = req.GetAccountNumber()
[Code]....
I am using VB.net code and SQL server 2005.I am havng below code for sending email in my vb.net code.
Protected Sub ibtnSendInvites_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ibtnSendInvites.Click
Try
Dim emailList As New List(Of String)
For Each curRow As GridViewRow In GridView1.Rows
[code].....
Now my problem is that some time if emailaddress is not valid or SMTP server is responding my application get hangs. I want to log my errors generated by my SMTP server in table or any log file it would be good if I can send back email to admin with the details of error occurred.
I am tring to send e-mail used VB 2008. Below is my code. The error message I am getting is "5 Failure sending mail at System.Net.mail.client.send(MailMessage message).I have two questions. 1.) What am I doing wrong? & 2.) Is there a way the get a more description error message.
message As
New System.Net.Mail.MailMessage
Dim mySmtpsvr[code].....
I want to learn how to add the menu options that appear when you click your right mouse button.So far I have a normal menu strip control, rich text box control and I have added a ContextMenuStrip control.
I have not got a clue on how to set the properties for the contextmenustrip on the richtextbox control, so when the user clicks the right mouse button the contextmenustrip appears.
Ok lets say I have a combo box with like 3 options in.
Ex:
Combobox
Option 1
Option 2
Option 3
How could I make it so the timer like every 5 seconds it will change from option 1 and be highlighted to option 2? then after so long, to option 3? and loop this process?