|
Do you mean that you are attempting to access the file before it is closed? If so, then what you are seeing is a valid exception since a second application (process) cannot access the file whilst it is in use. This is a basic locking mechanism to prevent the contents of files being corrupted. In this case you need to close the file in the first application before it can be used in the second.
...Steve
|
|
|
|
|
|
Hi!
I am having some problems using WSE3.0 and kerberos authentification. I wondring if some could help me with the code to:
1. How to get the current users kerberostoken?
2. How to use this kerberosToken to setClientCredentials on the client?
I`m getting a wse910, error, that I dont understand.
My code:
Dim KerbProxy As New WSKerberos.ServiceWse
KerbProxy.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim kerbToken As KerberosToken = New KerberosToken("MyComputername", "MyDomain")
KerbProxy.SetClientCredential(kerbToken)
KerbProxy.SetPolicy("Clientkerberos")' Policy created with 'wse3.0
textbox1.text = kerbProxy.HelloWorld
-- modified at 8:14 Monday 12th September, 2005
|
|
|
|
|
Hi,
I am having trouble extracting the Makernote contained in the EXIF data in a JPEG image from a digital camera. I am able to successfully extract the data contained in the makernote tag, however I cannot decode the data (ie, get the long focal length, short focal length, etc). I have seen the makernote information for different camera makes, such as Canon and Nikon (eg. http://www.burren.cx/david/canon.html[^]), but I cannot seem to work out how to match up the tag name and offset value to the data I extract from the EXIF data. Hopefully this makes sense.
Is anybody able to help me with this, ie provide any code samples or even pseudo code? Thanks in advance.
Cheers
|
|
|
|
|
I have 3 projects in VB.NET that I have included under 1 solution.
Project 1 is a class library that contains 1 class to describe a set of colours to be used in an application design.
Project 2 is a class library that contains a number of classes and windows forms.
Project 3 is a windows application.
Project 3 has an new instance of the class in Project 1, and an instance of a form in Project 2. When Project 3 uses the form in Project 2, the form has a public property where it can get and set the class type in Project 1. Everything first compiles OK and I can run the application, but every now and again the Studio IDE throws a build error saying that the class cannot be converted, when Project 3 tries to set the property in Project 2 using the instance of the class from Project 1. To stop this error I have to restart Studio, remove Project 1 from the solution and compile the solution again. Everything then works OK again for a while.
Is this a known issue in VB.NET, is there anything else I need to do to stop these intermittant compile errors.
Jason
|
|
|
|
|
I have created a simple xml file
<?xml version="1.0" encoding="utf-8"?>
<Event>
<Exception>
<Type>Error</Type>
<UserID>username</UserID>
<ERROR_ID>erroridID</ERROR_ID>
<ERR_DESP>Err_description</ERR_DESP>
</Exception>
</Event>
Now i want to append this xml file. I want to add a new exception in it. Any ideas.
-- modified at 5:09 Monday 12th September, 2005
|
|
|
|
|
What did you use to create the xml? You may want to look into the System.Xml namespace - it has a lot of nifty objects and methods. I would say you could use the XmlDocument to load the current xml and then use all the wonderful methods to alter it the way you want it.
|
|
|
|
|
Say i have this Xml file
<Books>
<Book type="1">
<Author>Peter</Author>
<Section>1</Section>
</Book>
</Books>
and when i add one more book then i want the output to be
<Books>
<Book type="1">
<Author>Peter</Author>
<Section>1</Section>
</Book>
<Book type="2">
<Author>Johnr</Author>
<Section>2</Section>
</Book>
</Books>
the code i am using
Dim WriteXMLFile As XmlTextWriter
Dim fs As FileStream = New FileStream("C:\Err.xml", FileMode.Open)Dim reader As New XmlTextReader(fs)
Dim reader As New XmlTextReader(fs)
WriteXMLFile = New XmlTextWriter(fs, ISOEncode)
Dim doc As New Xml.XmlDocument
'load file
doc.Load(fs)
Dim root As XmlNode = doc.SelectSingleNode("//Books")
If root Is Nothing Then
'if this is a new document create root
root = doc.SelectSingleNode("//Books")
Else
'create node
'get root node named users
Dim Usersnode As Xml.XmlElement = doc.SelectSingleNode ("//Books")
'add the new node
Dim newNode As Xml.XmlElement = doc.CreateElement("Book")
'add attributes
newNode.SetAttribute("type", m)
'add children nodes if any
Dim child As Xml.XmlElement = doc.CreateElement("Author")
child.InnerText = txtAuthor.Text
newNode.AppendChild(child)
child = doc.CreateElement("Section")
child.InnerText = txtSection.Text
newNode.AppendChild(child)
'add new node to users node
Usersnode.AppendChild(newNode)
m += 1
End If
'save doc
doc.Save(fs)
The output i am getting
<?xml version="1.0"?>
<Books>
<Book type="1">
<Author>Peter</Author>
<Section>1</Section>
</Book>
</Books><?xml version="1.0"?>
<Books>
<Book type="1">
<Author>Peter</Author>
<Section>1</Section>
</Book>
<Book type="2">
<Author>Johnr</Author>
<Section>2</Section>
</Book>
</Books>
Can you help?
|
|
|
|
|
Strange that cause when i took your code and tested it, it gave me the correct result. Try the code below it -
<br />
Dim doc As New Xml.XmlDocument<br />
'load file <br />
doc.Load("C:\Err.xml")<br />
Dim root As XmlNode = doc.DocumentElement<br />
<br />
If root Is Nothing Then<br />
'if this is a new document create root <br />
root = doc.CreateElement("Books")<br />
Else<br />
'add the new node <br />
Dim newNode As Xml.XmlElement = doc.CreateElement("Book")<br />
'add attributes <br />
newNode.SetAttribute("type", 3)<br />
'add children nodes if any <br />
Dim child As Xml.XmlElement = doc.CreateElement("Author")<br />
child.InnerText = "rr"<br />
newNode.AppendChild(child)<br />
child = doc.CreateElement("Section")<br />
child.InnerText = "rr"<br />
newNode.AppendChild(child)<br />
'add new node to users node <br />
root.AppendChild(newNode)<br />
End If<br />
'save doc <br />
doc.Save("C:\Err.xml")<br />
<br />
|
|
|
|
|
I am deverloping a window application with VB.Net
And I get a problem. I need your helps.
My problem is:
When my application show a report by report viewer. The Crystal report get a bug. The bug is "The parameter "E:\DANCO\Source\DPPS\Report\rptJobEntry_danco_dev.rpt" could not be found". But The "E:\DANCO\Source\DPPS\Report\rptJobEntry_danco_dev.rpt" report file is adready . Please, give to me a advice. Thanks very much.
|
|
|
|
|
I have this datagrid on a search page. once the search is complete it populates the datagrid. What i want to do is retrieve the datagrids uniqueidentifier and then move to another page once the user has clicked update which will populate with the info from the selected datagrid row. Any help much appreciated.
gfhg
|
|
|
|
|
U can use the Datakeys property of the Datagrid to get the value of the unique field for the selected Row in the datagrid .
Sub Update_Command(sender As Object, e As DataGridCommandEventArgs)
....
uniq = Grid.DataKeys(e.Item.ItemIndex)
....
End Sub
|
|
|
|
|
as inputbox is for inputting strings so can i use it to input integer data as well and how can i do it.if anyone has solution plz reply.
|
|
|
|
|
You can force a textbox to take ints only by handling the char event, and using char.IsDigit to set HAndled to true for non numbers.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
if you mean how to get an interger out of it than it's really basic:
a = int(inputbox("Enter number"))
if you rather want to know how to validate and check against an integer than it's a different story. AFAIK you can't do it with an inputbox but you can accomplish it through a textbox in a form as stated in the reaply before (and maybe have a look at the "validate" function).
|
|
|
|
|
You cannot do that to an InputBox since it runs modally.
You have two options:
1)Design your own frmInputBox and run it modally to get the input.
2)Just get the input value as strting, then use the Val() function to convert the input value to number and check if it really was a number.
|
|
|
|
|
how can i get an array of any control in visual basic to use them one by one by clicking one command button.
waiting for solution.thanx
|
|
|
|
|
What do you want to do ? VB6 or VB.NET ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am not sure I understand your question, and you need to specify what version of VB you are using.
In VB6 you can create arrays of controls and enumerate them like any array.
In VB.NET you cannot create arrays of controls, but you can add controls to the Controls collection of a form, a panel or a groupbox dynamically. You also can enumerate the control collections of any container (i.e. a form, panel, groupbox).
|
|
|
|
|
Is there an easy way to format a telephone number in a textbox on a form?
"(123) 456-7890" or point me in the right direction for something other than string manipulation.
currently reviewing MSDN string manipulation docs... being from big blue and old iron i would expect some simple ways to format input/return fields.
thanks in advance
|
|
|
|
|
You can use a reg ex validator to validate that this is the input you recieved. RegEx replace will let you enforce the () and - even if they were not there to start with.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
how do i take A strings data
and take all the chars or substrings and store them Array INDividualy...
so say if the data in the string is HELLO THERE
take H and store it to index 0 E store it to index 1 and so on and so forth even the space between HELLO and THERE.
|
|
|
|
|
|
String has a ToCharArray method.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Strings have a "Chars" property array, which is the string split into an array of characters, just like what you are wanting. For Example.
<br />
Dim S As String = "Test"<br />
<br />
S.Chars(0)
S.Chars(1)
S.Chars(2)
S.Chars(3)
You can also use the "ToCharArray" function of a String to get a specific substring of the string and split it into a character array. For Example.
<br />
Dim S As String = "Test"<br />
<br />
S.ToCharArray(2, 2)
Hope this helps,
Scott
"Some people spend an entire lifetime wondering if they made a difference. The Marines don't have that problem."
( President Ronald Reagan)
|
|
|
|