|
This happened because the original poster deleted his question, thereby orphaning the replys he got. It's a known issue and won't be fixed until the next release of the CodeProject web site.
|
|
|
|
|
Yikes this is a mess. I am trying to follow through the Changing color of text... thread. Almost there
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
i dont understand where r problem in code project forms coding. SInce question is 45 min ago. & your answer is 2 hour 45 minute ago. Also subject is different
Please note this bug
Also note that i reply christian but this reply add to Dave Note this thing
-- modified at 12:59 Friday 13th July, 2007
-- modified at 13:00 Friday 13th July, 2007
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Hi,
I am using Visual Studio 2005's Visual Basic developer. I have a problem that i need to extract the unicode from a text file to my progam. And normal character have not a problem but when come to a certain extent of the unicode set, it prompt a error saying that it is invaild.
Here is my code:
OpenFileDialog1.ShowDialog()
Dim direct As String
direct = OpenFileDialog1.FileName
Dim fs As FileStream
fs = New FileStream(direct, FileMode.Open)
Dim sr As StreamReader
sr = New StreamReader(fs)
Dim n1 As Integer
Dim s1(100) As Char
Dim n2 As Integer
n2 = 0
While sr.Peek >= -1
n1 = sr.Read()
s1(n2) = Chr(n1)
n2 += 1
End While
my input is this unicode, §. So when it read from file to here, it prompt the error. So please help me...!
Thanks and Regards,
A person who don't whether he is a newbie or novice.
|
|
|
|
|
jackie83sg2005 wrote: Dim s1(100) As Char
Dim n2 As Integer
n2 = 0
While sr.Peek >= -1
n1 = sr.Read()
s1(n2) = Chr(n1)
n2 += 1
End While
Wow - what a mess.
1 - why do you limit yourself to 100 characters, instead of using a List or something ?
2 - why do you read one character at a time ?
File.ReadAllText will read an entire file in one line of code.
Christian Graus - Microsoft MVP - C++
"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: Wow - what a mess.
Just imagine maintaining it in the future :->
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi,
thanks for commenting my previous program. I know that it is really in a WOW mess.
I try you method but I still have the unicode conversion problem that I posted in the first thread.
I appreciate your help. I have shorten the whole program as follows:
OpenFileDialog1.ShowDialog()
Dim direct As String
direct = OpenFileDialog1.FileName
Dim str As String
Dim adder As Integer
Dim reader As Integer
reader = 0
adder = 0
str = File.ReadAllText(direct)
reader = str.Length
Do While (adder <> reader)
Try
ComboBox1.Items.Add(str.Chars(adder))
adder += 1
Catch ex As Exception
End Try
Loop
So please help mi from the unicode's ASCII index is 167 after conversion. It is simple when you type in the unicode in to the windows form but I try to retrieve from file. WoW, it is very different and difficult, so need you people out that who is experted in it to help me out...
Thanks and Regards,
A person who do not know whether he is a newbie or novice.
|
|
|
|
|
What does the code look like that wrote the file?? Maybe it's not really Unicode where you think it is.
Or, there's another possilibity. Change the ReadAllText line to:
Imports System.Io
Imports System.Text
.
.
.
str = File.ReadAllText(direct, Encoding.Unicode)
|
|
|
|
|
Thanks alot. It works.. But need to manipulate the working of normal File.ReadAllText(direct) and File.ReadAllText(direct, Encoding.Unicode)...
thanks a lot once again
|
|
|
|
|
how do i make a array and fill the listview1.groups.addrange(arrayname) with the array?
i want to add groups this way so i can sort the array and add the groups name in the right order: A-Z
i dont have a lot experience with arrays.
thanks for your help!
|
|
|
|
|
If you don't know anything about arrays, I highly suggest picking up a book on VB.NET and going through it. Without this basic knowledge, you're going to find most projects impossible to do.
Dim groupNames(2) As String
groupNames(0) = "Group2"
groupNames(1) = "Group3"
groupNames(2) = "Group1"
Array.Sort(groupNames)
For Each groupName As String In groupNames
ListView1.Groups.Add(New ListViewGroup(groupName))
Next
I've kept this example very simple. There's another method for creating a ListViewGroup array, that can be used with AddRange, that uses an Array's ConvertAll method, but you have to supply a Converter delegate and method to do the conversion from String to a ListViewGroup object. But, if you don't know arrays, this litte topic will not make any sense at all...
|
|
|
|
|
hi thanks four your reply
I do understand how arrays work but i dont know witch type and how i script them.
the code does not work
my code:
Dim groupNames(2) As String<br />
groupNames(0) = "Group2"<br />
groupNames(1) = "Group3"<br />
groupNames(2) = "Group1"<br />
<br />
Array.Sort(groupNames)<br />
' ListView1.Groups.Add("Group1", "Group1")<br />
For Each groupName As String In groupNames<br />
ListView1.Groups.Add(New ListViewGroup(groupName))<br />
Next<br />
ListView1.Items.Add("Item1", 0).Group = ListView1.Groups("Group1")<br />
ListView1.Items.Add("Item2", 0).Group = ListView1.Groups("Group2")<br />
ListView1.Items.Add("Item3", 0).Group = ListView1.Groups("Group3")<br />
End Sub
|
|
|
|
|
svanheest wrote: the code does not work
Define "does not work". What DOES happen?? Do you get an error message??
Is your code running on Windows XP or above? Did you EnableVisualStyles in your project?
|
|
|
|
|
thanks for your reply,
sorry for the bad explanation
im using xp sp2 with vb.net 2005 wit visual styles enabled
listview propertys:
Groups = true
Style = tiles
press a button with this code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim groupNames(2) As String<br />
groupNames(0) = "Group2"<br />
groupNames(1) = "Group3"<br />
groupNames(2) = "Group1"<br />
<br />
Array.Sort(groupNames)<br />
' ListView1.Groups.Add("Group1", "Group1")<br />
For Each groupName As String In groupNames<br />
ListView1.Groups.Add(New ListViewGroup(groupName))<br />
Next<br />
ListView1.Items.Add("Item1", 0).Group = ListView1.Groups("Group1")<br />
ListView1.Items.Add("Item2", 0).Group = ListView1.Groups("Group2")<br />
ListView1.Items.Add("Item3", 0).Group = ListView1.Groups("Group3")<br />
End Sub
i get a group "Default" with item1, item2, item3 in it.
the other groups: group1, group2, group3 does not show in the listview
thx
|
|
|
|
|
Change the group creation code to add a Name to each group:
For Each groupName As String In groupNames
Dim lvg As New ListViewGroup(groupName)
lvg.Name = groupName
ListView1.Groups.Add(lvg)
Next
|
|
|
|
|
hi,
i want to generate a report for a project which will show all the methods or functions called from starting to end.
i.e suppose there is a web applicatioon project and this report should show the flow of the code. (i.e. starting from a button_click event to the database call along with all the methods being called)
so that when a new person will see, s/he able to know the flow of code quickly.
please help me if you have any solution to achive this
Santosh Kumar Maharana
|
|
|
|
|
There are packages that do this already, such as DevPartner[^].
|
|
|
|
|
You're treading in the waters of the ASP.NET forum. Your question really has nothing to do with VB.NET.
But, yes, a cookie that expires in a short time would do this. Ask this question in the ASP.NET Forum for more info.
|
|
|
|
|
Funny I did the same reply in the ASP.NET forum
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I have One Dataset with table name ="table1" having Columns
FileName = Name of file
File Type = Extension of File
File = Binary Data.
After Adding Binary in the Dataset. I generate XML from it by using DS.writeXML("c:\temp\abc.xml")
Now when I need to restore the file it creates the file but on opening the file says it is corrupt or it shows junk data ?
Any GuideLines ???
|
|
|
|
|
You are storing XML (which is plain text) into a binary blob field in your database. I suggest using varchar(max) in SQL 2005 or a text blob field for storage which should sort out your problem.
|
|
|
|
|
Please read my Message Again.. There is no SQL Server. Only Data moving to and fro in XML only.
|
|
|
|
|
Apologies. Trying to do too many things at once...
I assume you are reading the file with dataset.readxml, if not please post back. Otherwise can you provide an example of the content of the xml file which is causing the problem?
Thanks
|
|
|
|
|
The easiest way to do it would be to convert the binary data in the file to a Base64 string, store that in your field, then save the data out to the XML file. Convert.ToBase64String[^]
Keep in mind, XML was NOT designed to be a database. It's purpose is to pass messages between systems. Storing binary data in an XML file can result in VERY large files. Just something to think about...
|
|
|
|
|
Hello,
I have a datagridview which contains a combo box column (Status) with these values (To be ordered, Ordered, Delivered)
Then the user click on the combo box and selects Delivered, i want an event to fire so I can capture and compare what the user has selected. What is the best event to use?
My design is like this:
IF(cell is changed to "Delivered") Then
'Then do something
ELSE
'Do nothing
END IF
Also, the datagrid is bound to a binding source.
Many thanks for any suggestions or code,
Steve
|
|
|
|