|
Hi
thanks for the reply, just a couple of follow up questions, since I'm quite new to VB.
Should I run the regex with a "for each" statement, and nest it with a if statement to check the regex?
Would the InStr function work even though I have to check for 2 or 3 subdirectories as well (C:\norman\nvc, C:\norman\NPM)?
/TheScripter Aka.ScriptSurfer
|
|
|
|
|
TheScripter wrote: Should I run the regex with a "for each" statement, and nest it with a if statement to check the regex?
If I understand what your trying to get it, yes.
TheScripter wrote: Would the InStr function work even though I have to check for 2 or 3 subdirectories as well (C:\norman\nvc, C:\norman\NPM)?
Yes. So long as they all start with the same root directory, "C:\Norman", yes.
|
|
|
|
|
Hi
I'm now trying to get this to work.
for each StrFile in arrFiles ''search array
'intExist = instr(strFile, strSearchString, vbTextCompare)
'if intExist > 0 then
if instr(strFile, "C:\norman", vbTextCompare) > 0 then
counter = counter + 1
end if
next
msgbox(Counter)
But it doesn't work. It seems to fail on the line where the if statement begings.
Please help.
/TheScripter
|
|
|
|
|
You kind-of got it right. The problem is that "C:\Norman" does not equal "c:\norman". So, you force the case to match using:
if inStr(LCase(strFile), "c:\norman", vbTextCompare) = 1 Then
The equals one part is a safety measure. As written here, this will return true if and only if the string starts with any case-variation of "c:\norman".
|
|
|
|
|
In my application there are 3 tab pages
my problem is when i open my application 3rd tab pages should be open and other 1st and 2nd tab page should be disabled.
if i click on enable tab pages then both 1st and 2nd tab page will be enable and 3rd tab page should be disable
i have tried
tabpage.hide property of tab page but it is not work
|
|
|
|
|
|
Thanks for answer its too informatic and good
|
|
|
|
|
A TabControl stores it's pages in a <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.tabpagecollection_methods.aspx">TabPageCollection</a>[<a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.tabpagecollection_methods.aspx" target="_blank" title="New Window">^</a>] . You can add or remove pages from this collection.
Hope this helps
I are troll
|
|
|
|
|
my question is not about how to add or remove tab pages, but i want to enable - disable some tab page by programming
|
|
|
|
|
I'm sorry for wasting your time, but at the time it sounded like a viable alternative to me
I are troll
|
|
|
|
|
Its Ok Dear
As there is no any "Enabled" property of tab page so we have to check it is in tabcontrol's "SelectedIndexChanged" event like the following code
Private Sub tabCon_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tabCon.SelectedIndexChanged
If YourCondition Then
Me.tabCon.SelectedIndex = 1
End If
End Sub
to set defualt TabPage write the following code in form load event
Me.tabCon.SelectedIndex = 1 'Here 1 is the index of desired tabpage
|
|
|
|
|
we are working on the project controlling pc thru mobile ..
we are getting an error in the function parse mail as"invalid procedure call or argument"pls tell us how to rectify tat error...thanx in advance..
the code is as follows...
Private Function ParseMail() As String
On Error GoTo ErrTrap
'
'Parameters
'
'Purpose This procedure will check and let us know what action to be
' taken aginst the command sent from mobile
'
''
'Returns String - Command parsed from the mail
'
'
'Set up our variables
Dim oApp As Outlook.Application 'Create an object for outlook application
Dim oNpc As NameSpace 'Name space to drildown message folder
Dim oMails As MailItem 'To find our mail
Dim sCommand As String
Dim iMsgCount As Integer
Dim sMsgHead As String
'Lets apply values to our variables
Set oApp = CreateObject("Outlook.Application")
Set oNpc = oApp.GetNamespace("MAPI")
iMsgCount = 0
'Lets iterate through an easy For Each loop
For Each oMails In oNpc.GetDefaultFolder(olFolderInbox).Items
If oMails.UnRead Then
sParam = ""
'Change the Subject comparition string based on your service provider message
If UCase(oMails.Subject) = UCase(Trim(txtSubject.Text)) Then
sCommand = Mid(oMails.Body, 1, InStr(1, oMails.Body, Chr(13)) - 1)
If InStr(1, sCommand, "~") <> 0 Then
ParseMail = Mid(sCommand, 1, InStr(1, sCommand, "~") - 1)
sParam = Mid(sCommand, InStr(1, sCommand, "~") + 1)
Else
ParseMail = sCommand
End If
oMails.UnRead = False
End If
' If Send Unread mail Header is checked then send info to mobile
If chkUnReadMail.Value = 1 Then
If UCase(oMails.Subject) <> UCase(Trim(txtSubject.Text)) Then
If InStr(1, sAlertedMails, Trim(oMails.EntryID)) = 0 Then
sAlertedMails = sAlertedMails & Trim(oMails.EntryID) & ","
sMsgHead = "From: " & oMails.SenderName & vbCrLf
sMsgHead = sMsgHead & "Sub: " & oMails.Subject & vbCrLf
sMsgHead = sMsgHead & "DT: " & oMails.SentOn & vbCrLf
sMsgHead = sMsgHead & "MSGID: " & oMails.EntryID & "~"
SendSMS sMsgHead
End If
End If
End If
End If
Next oMails
Exit Function
ErrTrap:
txtLog = txtLog & "Error In ParseMail(): "
txtLog = txtLog & Err.Description & vbCrLf
End Function
waiting for your earliest reply..
pls help us with tat error..
|
|
|
|
|
You haven't said on which line the problem occurs. But, from the error message, you probably sent an incorrect argument to a method call somewhere. Without knowing on which line the error occured, it's pretty much impossible to tell you what went wrong.
|
|
|
|
|
Hi all
Can some one plz tel me what is the difference between textbox.text = "" and textbox.clear.
The same thing works for some some other controls also. ????
|
|
|
|
|
Basically both do the same task
We can blank a textbox control by assinging a blank string ie "" or by calling its Clear method
|
|
|
|
|
To make it worse, there's also
Textbox.Text = String.Empty Since it is a reference-type, you could even say
Textbox.Text = Nothing In programming there's seldom a single way or approach to do something
I are troll
|
|
|
|
|
Hi.
I need to read the news feed for example (http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/uk/rss.xml) and store the news part alone in a text file . I can get the content and store in a html file with TortugaActiveX. I need to do in vb 2008. I can use the text data for msagent. Please any one can help me..?
Thanks
Surej
|
|
|
|
|
So what part of this are you having problems with?? Downloading the file?? Parsing the XML?? Saving the data?? ......??
|
|
|
|
|
I can download the file ..I need parsing the XML file so i can get only the news part and save as a text file ..That i can use for msagent. I tried activex from chilkat too..i could not get the desired result
Thanks
Surej
|
|
|
|
|
Any easy way to do this..?
|
|
|
|
|
I'm trying to upload a file in VB.NET using an HtmlInputFile, but everytime I upload, the HtmlInputFile's PostedFile is Nothing.
Here is my ASP.NET code:
<form id="Form1" method="post" runat="server" enctype="multipart/form-data">
<asp:DataGrid id="dgTitles" runat="server" OnUpdateCommand="dgUpdate" DataKeyField="ID">
<Columns>
<asp:TemplateColumn HeaderText="Title" >
<ItemTemplate>
<asp:Label ID="lTitle" Runat="server">
<%# DataBinder.Eval(Container, "DataItem.Title" )%>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tTitle" Runat="server" text='<%# DataBinder.Eval(Container, "DataItem.Title" )%>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Image">
<EditItemTemplate>
<input id='fuEditImage' type="file" name="fuEditImage" runat="server" enctype="multipart/form-data" />
</EditItemTemplate>
</asp:TemplateColumn
<asp:EditCommandColumn UpdateText="Update">
</asp:EditCommandColumn>
</Columns>
</asp:DataGrid>
</form>
Here is my VB.NET code:
Sub dgUpdate(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
Try
Dim Title = CType(e.Item.FindControl("tTitle"), TextBox).Text
Dim fuUpload As System.Web.UI.HtmlControls.HtmlInputFile = CType(e.Item.FindControl("fuEditImage"), _
System.Web.UI.HtmlControls.HtmlInputFile)
If Not fuUpload.PostedFile Is Nothing Then 'This always = false
If Not fuUpload.PostedFile.FileName = "" Then
UploadImage(fuUpload)
End If
End If
Catch ex As Exception
'Handle Exception here
End Try
End Sub
When I upload a file, fuUpload is not Nothing, but fuUpload.PostedFile is.
The inputted "Title" text is recognized no problem.
I've also tried with FileUpload object and tag, instead of input tag and HtmlInputFile-- same result.
Can anyone tell me what I'm doing wrong? Why is PostedFile always nothing?
Thanks!
|
|
|
|
|
This question should really be asked in the ASP.NET Fourm. It has nothing to do with VB.NET at all.
|
|
|
|
|
Hi All,
I have a requirement for a tool/application/website that can help us to audit the security groups that an owner owns in Active Directory. I need an application that can do the following:
1. List the groups an owner owns (we have a database that contains group name, ads path, owner information hence the code can be linked with the database to get the information)
2. Owner of a group could select the group and veiw the members of that group (May be the code needs to be linked with AD to get the members of the group)
3. Using the tool we should be able to send the email to all the members of a selected group or specific members of the group ( This is required for audit purpose. owner needs to check with the members of the group if they still needs access to the group or not hence need to send an email. As a group can have hundreds of members, sending a manual email to everyone is time consuming). The email should contain a link which can take the user probably to one of the interfaces of our tool- that we need to develop. It should ask the member- do you still need access to the group and have two choices- yes and No. If the user selects Yes and submits nothing should happen. If the member selects No and submits it , member should be automatically removed as a member of the group and the owner of the group should be notified about the change (through an email or something).
I am not sure which programming language or scripting can help me to achieve this application. Any help will be greatly appreciated. It would be great if someone can take it up for me. I can give you the information that you may need for this project. You can let me know your terms and conditions.......if both of us agree we can start working on it at the earliest.You can email me at luvsohail2000@yahoo.com
Thank you.
|
|
|
|
|
Wrong site, we try and support, help coders. try rentacoder[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I'm shuffling a deck of cards, but seem to keep getting more than one of the same card, after the shuffle. So, I tried quite a bit trying to set the value of the card to not equal the subnum of the card, but it didn't work. Any ideas would be much appreciated. Thanks. Here's part of the code:
Private Sub Start_Click()
Dim arrDeck(52)
Randomize
CardCount = 1
Do While CardCount < 53
arrDeck(CardCount) = -1
CardCount = CardCount + 1
Loop
CardCount = 1
Counter = 0
Do While CardCount < 53 And Counter < 53
3 CardVal = Int((52 * Rnd) + 1)
If arrDeck(CardVal) = -1 Then
arrDeck(CardVal) = CardCount
Subnum = Counter
Image1(Subnum) = Image1(CardVal)
Image1(Subnum).Visible = True
CardCount = CardCount + 1
Counter = Counter + 1
Else: GoTo 3
End If
Loop
End Sub
|
|
|
|