|
Boas!
Já tive a ver a tua função e vai de encontro ao que necessito, com umas alterações.
Entretanto, a parte de texto que preciso está tanto entre "<" como entre "," ou ";".
Nesta instrução: inicio = InStr(texto, "<")
Não posso usar um OR algures para dizer que pode iniciar por diferentes caracteres?
Um abraço.
Do futebol de praia só vi o resumo na tv. Mas fizeram o mais díficil e depois falharam o mais fácil.
|
|
|
|
|
Tudo nice?
Explicitamente na instrução não.Tens de procurar individualmente e detectar qual dos caracteres detectaste, o "<", o "," ou o ";".
Para isso talvéz possas usar o método IndexOfAny().Este método retorna o índice da 1ª ocorrência de caracteres presentes num array.Acho k aí podes especificar os caracteres k desejas.Vê como funciona, onde estou n t posso dizer mais sobre este método.
Outra coisa que podias fazer, mas só se esses caracteres apenas forem usados como inicio/fim de tag era fazer um replace e simplificar as tags ficando assim por exemplo só com "," ou ";".Ou seja substituir "<",">" e "," por ";" e assim só tinhas esse caracter pra pesquisar.
Fica bem.
PS:Pensei k eras brazuca por isso é k falei do fute. de praia...era pra t dar tanga, mas como és português n correu bem...
Never say never
|
|
|
|
|
By using below code I will be doing drawing on paint event of picturebox, although it is drawing perfectly but not as free hand drawing.
code:
Enum PathColor
BLUE1 = 0
blue2 = 1
blue3 = 2
blue4 = 3
GREEN1 = 4
green2 = 5
green3 = 6
green4 = 7
RED1 = 8
red2 = 9
red3 = 10
red4 = 11
white1 = 12
black1 = 13
End Enum
Enum pathwidth
blue1w = 0
blue2w = 1
blue3w = 2
blue4w = 3
green1w = 4
green2w = 5
green3w = 6
green4w = 7
red1w = 8
red2w = 9
red3w = 10
red4w = 11
whitew = 12
blackw = 13
'five = 0
'fifteen = 1
End Enum
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Create GraphicsPath for each color
'Me.picboard.BackColor = System.Drawing.Color.White
'Me.picboard.ForeColor = System.Drawing.Color.White
Dim pmb As Bitmap = picboard.Image
pmb.MakeTransparent()
'Me.picboard.BackgroundImage = Me.picboard.Image
For i As Integer = 0 To 13
path(i) = New GraphicsPath
'path(i).Reset()
Next i
' Create each color
'Dim myPen As Pen = New Pen(Color.FromArgb(64, Color.Orange), 16)
' myUserColor(PathColor.RED1) = myUserColor(PathColor.RED1).Red.Transparent
myUserColor(PathColor.RED1) = myUserColor(PathColor.RED1).Transparent.Red
myUserColor(PathColor.red2) = myUserColor(PathColor.red2).Transparent.Red
myUserColor(PathColor.red3) = myUserColor(PathColor.red3).Brown
myUserColor(PathColor.red4) = myUserColor(PathColor.red4).Brown
myUserColor(PathColor.BLUE1) = myUserColor(PathColor.BLUE1).Blue
myUserColor(PathColor.blue2) = myUserColor(PathColor.blue2).Blue
myUserColor(PathColor.blue3) = myUserColor(PathColor.blue3).Cyan
myUserColor(PathColor.blue4) = myUserColor(PathColor.blue4).Cyan
myUserColor(PathColor.GREEN1) = myUserColor(PathColor.GREEN1).Green
myUserColor(PathColor.green2) = myUserColor(PathColor.green2).Green
myUserColor(PathColor.green3) = myUserColor(PathColor.green3).Yellow
myUserColor(PathColor.green4) = myUserColor(PathColor.green4).Yellow
myUserColor(PathColor.white1) = myUserColor(PathColor.white1).White
myUserColor(PathColor.black1) = myUserColor(PathColor.black1).Black
myPenWidth(pathwidth.red1w) = 5
myPenWidth(pathwidth.red2w) = 15
myPenWidth(pathwidth.red3w) = 5
myPenWidth(pathwidth.red4w) = 15
myPenWidth(pathwidth.blue1w) = 5
myPenWidth(pathwidth.blue2w) = 15
myPenWidth(pathwidth.blue3w) = 5
myPenWidth(pathwidth.blue4w) = 15
myPenWidth(pathwidth.green1w) = 5
myPenWidth(pathwidth.green2w) = 15
myPenWidth(pathwidth.green3w) = 5
myPenWidth(pathwidth.green4w) = 15
myPenWidth(pathwidth.whitew) = 5
myPenWidth(pathwidth.blackw) = 5
End Sub
Paint event code:
Dim CurrentPen = New Pen(Color.FromArgb(myAlpha, myUserColor(index)), myPenWidth(index))
'Set up the pen
Graphics.FromImage(picboard.Image).DrawPath(CurrentPen, path(index))
Welcome any help!!
|
|
|
|
|
I didn't trawl though your code, but freehand drawing is easy - just catch the mousemove event, and every time, add the mouse position to a path object, and then draw the path in your paint event ( obviously invalidate on mouse move so it draws ). I have a paint program here on CP called 'Doodle'. I think it's in C++, but its in GDI+, so the code should port pretty easily.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i wants to send fax through vb.net application
i added reference of faxservice'sdll
and usiong the following code:
FaxServerClass fs = new FaxServerClass();
fs.Connect("mymachine"); //specifies the machinename
object obj = fs.CreateDocument("myfilename");
FaxDoc fd = (FaxDoc)obj;
fd.FaxNumber = "myfax#";
fd.RecipientName = "Tester";
int i = fd.Send();
MessageBox.Show(i.ToString());
fs.Disconnect();
i dont have modem
but have lan card which is connected to internet
how can i send fax
|
|
|
|
|
Dont really know much about this but could you give us the error/output that you recieve when you run the code.
Do you have Windows fax services installed and configured on the computer in the connect("mymachine") line?
|
|
|
|
|
yes
installed. is there any way any dll in .net to send fax
i don't wants to use com object
any example ?
|
|
|
|
|
Hello,
I want to Stop my printer after it finished printing. But when printing of a page (even it contains only one line) finished, the printer ejects the page. I want to have control on page-tracking.
Thank you
|
|
|
|
|
I am working on an app that allows me to enter items into a listview control, I also would like to add a image to that particular item how can I do that using the select case function? Or is there another way to do that? Also I want to be able to double click on any item in the listview control and it will display information about the selected item. I have been having trouble selecting item from the ListView control using Select Case.
Can you please let me know what I am doing wrong….
Thanks
Thanks cPod....
|
|
|
|
|
Hi!
1 - Concerning adding items and associating an image to them you could associate an ImageList to the smallImageList or largeImageList property of the class and then when you're creating the items do:
myListView.Items.Add(New ListViewItem("blablabla", myImageIndex))
myImageIndex is the imageList index of the image you whish to show in the item.
2- To show Info about ONE selected item you have to put this code in the doubleClick event of the Listview:
myListView = CType(sender,ListView)
ListViewSelectedText = myListView.SelectedItems(0).Text
With this you're getting the text of the item.You can also have for example some info in the tag property...
ListViewSelectedTag = myListView.SelectedItems(0).Tag
NOTE: If you have the multiselect property active then you'll have to iterate through the selectedItems collection and get the info you need
Never say never
|
|
|
|
|
Is it possible to bind images from a database into a ListView Control?
Thanks
Thanks cPod....
|
|
|
|
|
Hi!
I've never done that but maybe you should check out the bindingContext property.
Sorry i can't give you any more help.
Never say never
|
|
|
|
|
i have a big prob. i'm doing a mail filtering system but have no idea on starting to code it. my system need to get incoming mails then scan the mails to filter spam. one of the function is to limit mail's size. maximum mail size allowed is 10000KB. mails that exceed dis size will be considered spam. anyone knows how to code dis whole thing in VB.NET??
|
|
|
|
|
TIFC wrote:
anyone knows how to code dis whole thing in VB.NET??
Probably, if they expend a considerable amount of time to the problem. Your best solution if you want a reasonable response here is to break the problem down into smaller problems, and then those smaller problems in to even smaller problems still. If you get stuck on a small problem then it will probably be of a size where you can expect a more helpful response from people on this forum.
Most people who respond on this, and any forum, will only respond to things that they can immediately or very quickly answer. Your question requires several hours of effort just to begin to produce a response that would be useful for a question that is so vague.
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
i would like to know how to create a multithreaded server which listen to port 25 using vb.net.
urgent, pls help. 10s
|
|
|
|
|
Hi All,
how can i write the codes to read the input/output file and then send the printing command in the windows service????
can someone give me some guides.Please...i really need help....
besah
|
|
|
|
|
The fact that you're in a service should not matter, just look into the System.IO namespace for how to read and write files. There are also some articles on this site to do with .NET printing, I believe.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I want to search for a data in a table within an untyped DataSet, how do I obtain the row number or index of the datarow found with the following statement?
Dim drwObj As Data.DataRow
drwObj = dsObj.Tables("LocalTable").Rows.Find("MyData")
If Not (drwObj Is Nothing) Then
Dim intRowNo AS INTEGER
intRowNo = ???
End If
Or any other methods that could help me to identify the row number would do just fine. Thanks
|
|
|
|
|
The name DataSet should give you a clue. The information in it is a "set" of data. There is no concept of a row number in a "set". It may be possible to simulate a row number, but depending on the implementation that row number may change arbitrarily during the course of operation.
You can write a routine that scans through the dataSet looking for a row that is the same as the one you are looking for. However, this is a brute force operation and could take a considerable amount of time depending on how many rows you had to look through.
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Anybody ever see these Bible Code programs?
I want a text control that will put circles of whatever color I want around whetever character I want it around all within the textbox.
Anything out there like that?
Even though I would call my self an experienced VB 6 programmer, .NET has me scratching my head a lot. I dread writing even the search algorithm, let alone making a custom textbox.
Thanks,
Jim
|
|
|
|
|
I'm rather new to this so I hope someone can help. After creating a new windows application and using Project, Add New Item then selecting the Data Form Wizard icon in the templates box I'm getting an error message "Could not run the C:\Program Files\...\WinDataForm.vsc wizard". I'm using Visual Studio 2002 in case that's of any relevance. If someone could point me in the right direction I'd appreciate the help.
Thanks
|
|
|
|
|
i'm using the find method of DataView to search for students using the student's id or student's last name, i have no problems using the student's id for search. my only problem is, when i search using the student's last name it seems that it is not working sometimes it will display the wrong student for example i'll put "Cross" as my student's last name then it will search and display "Mason". how can i resolve this?, is there something wrong with my code.
Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As_ System.EventArgs) Handles btnGo.Click
Dim i As Integer
Dim StudDV As Data.DataView = New Data.DataView(Dsstudent.student,_ "", "StudID", Data.DataViewRowState.CurrentRows)
Dim StudDV1 As Data.DataView = New Data.DataView(Dsstudent.student,_ "", "StudLastName", Data.DataViewRowState.CurrentRows)
If cboFind.Text = "Student ID" Then
i = StudDV.Find(txtSearch.Text)
ElseIf cboFind.Text = "Student Name" Then
i = StudDV1.Find(txtSearch.Text)
End If
StudentBindingSource.Position = i
End Sub
by the way i am using access database and have 2 indexes the student id as my primary key and last name as my second index.
thanks in advance
|
|
|
|
|
hellow to all
i am trying to run a code that access a DB find a value that was entered by user ..
for this code i am useing sql statments , but when i run the code i recive this error msg
No value given for one or more required parameters .
i had cheaked the code trillion time and the db connection is fine !
if any one have any idea how can i run an sql statment in vb.net to find a value please help ! , because when i run a regular select statment it show's to me the tabel fine but when i user the where statment ,i get errors .
here is the code
Dim sql As String
sql = "select * from Customer Where Customer_ID ="
Dim objconn As New OleDb.OleDbConnection(sConnection)
Dim objdataadapter As New OleDb.OleDbDataAdapter(sql & TextBox1.Text, objconn)
Dim objds As New DataSet("Customer")
Dim objdv As DataView
Dim objtabel As DataTable
Dim ds As DataSet
ds = New DataSet("Customer")
Try
objconn.Open()
Catch ex As Exception
Windows.Forms.MessageBox.Show(ex.Message)
End Try
If objconn.State = ConnectionState.Open Then
Try
objdataadapter.Fill(ds, "Customer")
objtabel = objds.Tables("Customer")
objdv = objtabel.DefaultView
DataGrid1.SetDataBinding(ds, "Customer")
' TextBox2.DataBindings.Add("text", ds, "Customer")
Catch ex As Exception
Windows.Forms.MessageBox.Show(ex.Message)
End Try
End If
End Sub
|
|
|
|
|
microuser_2000 wrote:
but when i run the code i recive this error msg
No value given for one or more required parameters .
So, where do you receive this error message? What line of the code generates it.
Also you should be aware that your code is highly susceptable to a SQL Injection attack. You are injecting the text value of TextBox1 directly into the SQL statement. What happens if the value in TextBox1 is blank? You SQL statement is incomplete. What happens if someone types the following into TextBox1:
0; DELETE Customers;-- What happens is that your full SQL Statement will look like this:
select * from Customer Where Customer_ID = 0; DELETE Customers;-- Which will go ahead and delete everything in your Customers table.
You might find the following article useful: SQL Injection Attacks and Some Tips on How to Prevent Them[^]
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
when i run the code i use IO Exception to generat the erros so i get this error as a messagebox and i do not get line of error ..
i know that it is not securie to run code like mine , but i will use a function the will filter input to textbox ...
but what i am looking for now is how to write a code that can pick a value from db !!!
thxx for ur help ...
|
|
|
|