|
I have a text file with the AE character in it when I try to read it with File.ReadAllText it does not read the character (it just removes it). I have tried File.ReadAllBytes(PATH/FILENAME.txt).replace(chr(198),"AE") and a couple other Replace ideas and so far nothing has worked. The only method I have found that works is:
Bytes = File.ReadAllBytes("PATH/FILENAME.txt")
For i = 0 To Bytes.Length - 1
TextFile += Chr(Bytes(i))
Next
This is horribly inefficient but does work...
Any better ideas?
|
|
|
|
|
Use the overload of the ReadAllText method that takes an encoding to specify the encoding that was used to create the file. Example:
text = File.ReadAllText(path, Encoding.UTF8)
---
single minded; short sighted; long gone;
|
|
|
|
|
hello evryone!!
m workin on fingerprint matchin algos nd hav selected the minutiae based approach.
the image enhancement,thinning nd stuff is done however m stuck on the pattern matching thing.
my code works on the pixel co-ordinates and pixel orientation approach, wherein i am confused as to how do i match the pixel cordinates as there is always a displacement problem in the input and the template image , evenif they have the same orientation
i am workin on vb.net 2003
|
|
|
|
|
You can't compare absolute coordinates, as the images you are comparing may be offset, scaled and rotated against each other. Express the relations between the coordinates as vectors, so that you can easily scale and rotate them when comparing them.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hello!
I have one string value e.g (32765) and I would like to know how I can covert it to a color.
Dim myColor as Color
myColor = my.resources.FormBaseColor ' that is a string
Thanks for bunches!
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
The real question is, how do you *expect* 32765 to convert to a color ? If you mean it's an RGB value, you can use int.TryParse to get a number, and bit masking to extract the three values, which you can then turn into a color. So, 32765 && 0xFF, 32765 && 0xFF00, and 32765 && 0xFF0000 will get your three byte values.
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 )
|
|
|
|
|
You can use the Color.FromArgb method to convert a number to a color. It expects a 32 bit value where there are eight bits each for alpha, red, green and blue.
If the value represents a color without an alpha value, you use FromArgb twice to set the alpha value. Example:
Dim c As Integer = &HFFFF00 'yellow<br />
Dim myColor As Color = Color.FromArgb(255, Color.FromArgb(c))
If your value represents a color in a different way, it may be simpler to extract the color components and create a color from that:
Dim myColor As Color = Color.FromArgb(red, green, blue)
---
single minded; short sighted; long gone;
|
|
|
|
|
Hello,
I know that there are many projects that show how to implement checking the md5 hash of a file in vb6 however I was not able to find any for vb.net can any one point me to the right direction ?
Thanks
Al968
Avast Antivirus-<url>http://www.avast.com<url>
|
|
|
|
|
Md5 is built into the System.Cryptography namespace. Therefore, no-one is going to write sample code to do it, the framework does it already.
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 )
|
|
|
|
|
Thank you for your responce, I didn't know it was built-in.
Thanks
Al968
Avast Antivirus-<url>http://www.avast.com<url>
|
|
|
|
|
I want to bind data in a Select Statement in a stored procedure in SQL Server 2005 to a GridView
in Visual Basic 2005.
I set the DataSourceID of the GridView to the Stored Procedure and in runtime Bind the Data with
DataBind Method.
But it dose not work.
Please help me.
|
|
|
|
|
It sounds like you have some misconceptions about how all this works. Post the code you're using to get the data and bind the grid and we'll see if we can straighten it out. Is this an ASP.NET app or Windows Forms?
You don't bind to a stored procedure. You call a stored procedure to return the records you want. The records end up in either a DataTable or some other bindable source. You then bind the grid to that record set.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I wrote this code
<asp:gridview id="GridView1" runat="server" allowpaging="True" autogeneratecolumns="False"
="" backcolor="#CCCCCC" bordercolor="#999999" borderstyle="Solid" borderwidth="3px" cellpadding="4" cellspacing="2" forecolor="Black" datasourceid="SQLDS_Select_Project">
<footerstyle backcolor="#CCCCCC">
<columns>
<asp:boundfield datafield="Number" headertext="تعداد">
<asp:boundfield datafield="Model" headertext="مدل">
<asp:boundfield datafield="Heavy" headertext="سنگین">
<asp:boundfield datafield="Kind" headertext="نوع ماشین">
<asp:boundfield datafield="Number_M" headertext="تعداد فعال در پروژه">
<asp:boundfield datafield="Title" headertext="عنوان پروژه">
<asp:boundfield datafield="Row" headertext="ردیف" readonly="True">
<rowstyle backcolor="White">
<selectedrowstyle backcolor="#000099" font-bold="True" forecolor="White">
<pagerstyle backcolor="#CCCCCC" forecolor="Black" horizontalalign="Left">
<headerstyle backcolor="Black" font-bold="True" forecolor="White">
<asp:sqldatasource id="SQLDS_Select_Project" runat="server" connectionstring="<%$ ConnectionStrings:SamanMohitConnectionString %>"
selectcommand="Select_Project" selectcommandtype="StoredProcedure">
<selectparameters>
<asp:parameter defaultvalue="Farsi" name="F_Language" type="String">
and in .aspx.vb i write this code
Protected Sub Page_Load(Parameters)
GridView1.DataBind
End Sub
|
|
|
|
|
What code? This is HTML. There's nothing here that calls any kind of database.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I am have to use Sybase database in my appliction.
Is there any way to use it without installing ODBC Driver on each machine, I mean like is there any way to directly connect to Sybase by imporing a reference dll or something.
Thank you!
"Mess with the Best, Die like the rest"
|
|
|
|
|
Well, you could TRY to use the OleDb methods, but they're not going to support SyBase the best since they're kind of "generic". Other than that, you have no choice but to install the driver, or use a different database, like SQL Server or Access, that comes with the drivers already installed.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
If now OleDb wht other choice do i have, since i am using a IVR system that only deployes Sybase as their database.
Thank You!
"Mess with the Best, Die like the rest"
|
|
|
|
|
M. Nauman Yousuf wrote: since i am using a IVR system that only deployes Sybase as their database.
The only other choice you have is to install the drivers.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'm trying to create an application where i can browse the Active Directory OU folder structure. I need to select an OU and need the OU name for a next action in the application.
Any help is welcome.
Roland
|
|
|
|
|
|
Already found some information like this below, but it doesn't show any results:
mports System
Imports System.DirectoryServices
Public Class Form1
Class DirLister
Shared Sub Main(ByVal args() As String)
Dim enTry As DirectoryEntry = New DirectoryEntry("LDAP://192.168.1.1")
Dim mySearcher As DirectorySearcher = New DirectorySearcher(enTry)
mySearcher.Filter = ("(objectClass=computer)")
Dim resEnt As SearchResult
For Each resEnt In mySearcher.FindAll()
Form1.Text = (resEnt.GetDirectoryEntry().Name.ToString())
Next
End Sub
End Class
|
|
|
|
|
Replace this line :
Dim enTry As DirectoryEntry = New DirectoryEntry("LDAP://servername/DC=DCNAME, DC=local")
hopes it helps,
Wachill
Signature has been encrypted
|
|
|
|
|
That didn't work either, i also changed it after your suggestion into:
Imports System
Imports System.DirectoryServices
Public Class Form1
Class DirLister
Shared Sub Main(ByVal args() As String)
Dim enTry As DirectoryEntry = New DirectoryEntry("LDAP://mydomain.local/RootDSE")
Dim mySearcher As DirectorySearcher = New DirectorySearcher(enTry)
mySearcher.Filter = ("(objectClass=computer)")
Dim resEnt As SearchResult
For Each resEnt In mySearcher.FindAll()
Form1.Text = (resEnt.GetDirectoryEntry().Name.ToString())
Next
End Sub
End Class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Do i forgot something? I just want to test this with display the results at my empty form and work from there with the results.
Roland
|
|
|
|
|
Can you tell me what is not working correctly. Is it that you are not getting the required results or that you are getting an error message.
Signature has been encrypted
|
|
|
|
|
Ummm... To be frank, you're copying and pasting code that you don't understand at all, and I'm not talking about the directory searching code. It's this
Form1.Text = blah, blah, blah
in int your Main. The search code may actually be working, but since you put all this in the Main method, before the form even shows on the screen, you'll never see the results. And, the Text property of the Form just changes the TitleBar text. It doesn't show up in the form itself.
Get rid of Main method and move it into the Form_Load event. Add a ListBox to the Form and expand it to cover the form. Then change the code in the Form_Load event:
Dim enTry As DirectoryEntry = New DirectoryEntry("LDAP://your AD server/AD path to search")
Dim mySearcher As DirectorySearcher = New DirectorySearcher(enTry)
mySearcher.Filter = "(objectClass=Computer)"
Dim resEnt As SearchResult
For Each resEnt In mySearcher.FindAll()
ListBox1.Items.Add(resEnt.GetDirectoryEntry().Name)
Next
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|