|
Hi,
I wonder if anyone can help me or put me on the correct path. I am trying to write a program that will reset my active directory password. Is there any sample code that is out there that deals with active directory procedures.
|
|
|
|
|
Hi there everyone,
I'm trying to do what is basically a String.Replace but not quite.
I have a string e.g. "{Team}/{Team} Index" and a hashtable of replacement string values, e.g. "Wigan Athletic", "Manchester United".
I need to loop through the hashtable and replace the first occurrence of the substring "{Team}" with "Wigan Athletic", and then on the next iteration replace the substring "{Team}" with "Manchester United".
The problem I've got is (obviously) String.Replace replaces all occurrences of "{Team}" the first time through, and using regex every expression I write seems to select both occurrences.
Is there a way to stop the regex matching after hitting the first match? Or otherwise some method of doing this that I'm just missing?
Any help much appreciated
Thanks,
James
|
|
|
|
|
There are several versions of the Regex Replace method available. One allows you to specify the maximum number of replacements to make.
|
|
|
|
|
Thank you very much, I noticed that about 5 seconds before you replied.
Thanks,
Jim
|
|
|
|
|
Is this an old question or a new one? Or has your account been hacked?
|
|
|
|
|
Looks to me like something went wrong at CodeProject.
|
|
|
|
|
Dunno. It showed up in moderation yesterday.
|
|
|
|
|
i was declaring the API and got the error
Public Shared Function <DllImport("kernel32")> _
abc(byval str as string)as integer
problem is in <
identifier expected.
|
|
|
|
|
The DllImport attribute has to go on the line before the function declarartion, not in the middle of it...
|
|
|
|
|
it's an api
and the function abc is nothing but i provided as an example.
there is some other function.
|
|
|
|
|
yaa,i know function abc is an example
use this code
<<system.runtime.interopservices.dllimport("kernel32.dll")> _
Public Shared Function abc(ByVal s as string) As Integer
End Function
use following link
http://pinvoke.net/default.aspx/user32.GetWindowLong
Hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
thanks boss .it is working
|
|
|
|
|
How to detect Internet connection is live of disconnected in VBS
Me and Program both have logical waves.
|
|
|
|
|
Can some1 please help me with the VB.NET code to insert/save a picture/image to a sql server db. Please also inclide the one that will help me retrieve those images.
jtc
|
|
|
|
|
i get this exception at the Open() method while connecting to a remote SQL server :
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
while i have
Windows server 2003 on both systems.
SQL Server 2000 on both systems.
application is developed in visual studio 2005
thank you for a quick response
|
|
|
|
|
How to validate the text in the text box when entering an email-id?
sri
|
|
|
|
|
With a regular expression, generally. There are lots of examples on the web of regex for email, Expresso comes with one ( and you should download it as it's invaluable for regex ), and then handle the leave event of the control, so you validate the input via the RegEx class when the user has finished typing.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I want to display some invoice details in a datagridview (dgv). I want the user to be able to click a check box, which I've added to the dgv, so that they can indicate whether they want the invoice amount or invoice total to be used in calculations on that invoice. There are boolean properties called UseInvAmount and UseInvTotal in the invoice object. I can get the check box to appear in the grid okay, but clicking on it does not make a check appear, even though the cellContentClick sub fires when the checkBox cell is clicked. I've got code that handles the 2 events: cellValueNeeded & cellValuePushed, and I've also added 2 event handlers to the dgv (DataGridViewCellEventHandler & DataGridViewRowsAddedEventHandler) and registered the dgv's "with events", but the cellValueNeeded and cellValuePushed code are not triggered by clicking on the checkboxes. Can anyone tell me what I've left out or how to make a checkbox click on & off, and work independently of another one?
Pauki
|
|
|
|
|
i cannot understand your requirement fully pauki.the event CellValueChanged is fired after a checkbox is checked.but before handling that event u have to handle one more even ie CurrentCellDirtyStateChanged.i have given that code below
Private Sub DataGridView1_CurrentCellDirtyStateChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.CurrentCellDirtyStateChanged
Try
If DataGridView1.IsCurrentCellDirty Then
DataGridView1.CommitEdit(DataGridViewDataErrorContexts.Commit)
End If
Catch ex As Exception
End Try
End Sub
after that handle the event CellValueChanged like this
If e.RowIndex > 0 Then
If DataGridView1.Item(0, e.RowIndex).Value Then
MsgBox("hello")
End If
End If
if u need more explantion reply
shally
|
|
|
|
|
thanx Shally,
I did actually try this code too,
and altho it fired, I was still bothered by the fact that it didn't automatically set the check in the box (I guess I could try to set the value in the checkbox, but instead I tried using 1 unbound checkbox, useInvTotal, rather than the 2 bound boolean properties, and that seemed to work). I can't believe that it's so complicated just to get a checkbox to write back to the db - (i.e. cellContentClick is also fired on clicking a cell, and all this need for cellValueNeeded, cellValuePushed etc. to set the initial values...) I'll see if I can get your suggestion to work anyway. thanks again, PK
|
|
|
|
|
hi all,
I have MS-Access database .So how i can protect by database from running malicious code.I think MS-Access don't provide Stored Procedure.So attacks are obvious on the database.
Thank You
|
|
|
|
|
You can write a type of proc for later versions of Access. For earlier versions, all you can do is sanitise the input yourself, the main thing is to make sure you double quotes, so " and ' become "" and '' within the string. If it's a string, it's going to be fine. If it terminates a string, then anything after it becomes SQL. You should do this anyhow, either get rid of quotes, or prepare them to be passed through to the database.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Christian Graus wrote: "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Seriously?! :swoon:
|
|
|
|
|
hi all,i'm using listview code by vb .net to display a information. how i can get the value from listview .
company customer value
------- --------- -----------
1 a 10
2 b 20
1 c 30
how i get the customer value in row 2, if my mouse click in row 2.
i read the data from the database and the columns sequence maybe change,
eg. the database fields is fldCom,fldCust,fldValue. i will retieve the fldcust only.
eg. fldcust in columns 2 and after change fldcust will in columns 3.
retrive it without know the index.
thank's in advance for your help
-- modified at 2:36 Wednesday 30th May, 2007
|
|
|
|