I am currently returning an XmlDocument from a webservice using the following:
public XmlDocument GetLawUpdateGenerationXML(short versionNum)<br />
///Code here to gets the xml from the db<br/> }<br />
Then in my page that consumes the webservice I did the following:
If you wish to append a child node to the document root of an already created XML file then
be sure to have using System.Xml;
then the following will add a node:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("path to your xml file that already had a root document node");
XmlNode newXmlNode = xmlDoc.CreateElement("tagname");
newXmlNode.AppendChild(xmlDoc.CreateTextElement("The tag's text node Value"));
Will anyone help in opening a View which is having its own Interface and Presenter. I want to open this view from base presenter in ModalWindow style. I need a sample application so that i can understand better..
I need a sample application so that i can understand better..
Sorry. I can't create or upload the sample for you but I will tell you the steps that you need to follow to open the view in popup form. (I believe that you have some ideas about CAB (Composite UI Application Block) Frameworks and terms.)
#1. First, you need to add the View in WorkItem or ModuleWorkItem.
Dim objMyView As MyView = WorkItem.SmartParts.AddNew(Of MyView)(MyNamespace.Constants.SmartPartNames.MYVIEWID)
Note: If you are using SCSF, you can write the code above in AddView() methods.
#2. Add a form to your project and put the DeckWorkSpace in this form.
#3. Write the code below in your presenter when the view raise the event of presenter.
Dim formPopUp As New Infrastructure.UI.Form()<br />
formPopUp.Title = "MyView"<br />
formPopUp.StartPosition = FormStartPosition.CenterScreen<br />
formPopUp.FormBorderStyle = FormBorderStyle.FixedDialog<br />
formPopUp.MaximizeBox = False<br />
formPopUp.MinimizeBox = False<br />
Note: Infrastructure.UI.Form should have one more constructor like that
Public Sub New(ByVal view As Control)<br />
Public Sub New(ByVal view As Control)<br />
Me.ClientSize = New System.Drawing.Size(view.Width, view.Height)<br />
view.Dock = DockStyle.Fill<br />
'Adding View to Form<br />
Me._contentPanel.Controls.Add(view) '' Note: _contentPenel is deckworkspace control.<br />
End Sub<br />
many thanks for your reply. If you have a sample application then it will be of more useful to me. If you have please give me, of even if you know the link from where i can download please provide me the link.
Where Filepath is : "E:\Images\"
and FileName is a random image file name : "03834634.tif"
However "E:\" is a mapped drive on a shared network folder eg. "\\192.168.253.12\images$\"
I write the "FilePath + FileName" to a file and use that in Windows Explorer and I can successfully open the file. So the path and file name is correct however the code returns that the file does not exists ??? If I however change the filepath to my local drive the code would return correctly when the file exists and when it does not exits. Can anybody give any assistance why "File.Exists()" does not work on a mapped network drive ???
Notice the '@' character. That is a special character that specifies that you are entering a verbatim string literal.
The '\' character usually triggers an escape sequence, but with the @ character in front of it, it is treated as any other character. This technique probably won't work for you though, because your '\'s are embedded inside your strings. You probably are going to want to do a string replace on the '\' to make it '\\' . That will specify that you are triggering an escape sequence and wanting to type a '\'
-- modified at 16:02 Wednesday 29th August, 2007
[Note] The "\\" included in my snippet is NOT the same "\\" that you will have to use. My "\\" indicates that I'm wanting to access an external resource(which works with the '@'). YOUR "\\" (without the @) will handle your first slash as an escape initiation and the second slash as a print
Are doing this in Vista?
I noticed that mapped drives in vista don't work with direct access via driver letter. I had to have the program resolve the full path
your example: @"\\192.168.253.12\images$\" you have to resolve their path that (like Alaric_ said)
Thank you for all your help. It turned out to be a permissions problem.
The user under which the application runs does not have the permission but I had. So with explorer I would be able to open the file but the programs user would not get access. Thanks for all the help.
I'm trying to read in and decrypt some encrypted data that is written to a file by an outside program. The program uses a form of rijndael encryption to encrypt the file. It uses a key, and I have the key, but I don't think it uses an initialization vector ..
this is what it uses:
// key - The 128/192/256-bit user-key to use.
// chain - initial chain block for CBC and CFB modes.
// keylength - 16, 24 or 32 bytes
// blockSize - The block size in bytes of this Rijndael (16, 24 or 32 bytes).
I'm not real solid on how Rijndael encryption works, obviously, so if anyone could help steer me in the right direction, that would help.