|
Luc Pattyn wrote: 3. set Form.DoubleBuffered true; that will not really solve much but it may change the look and
feel in the way you prefer (I expect it to show the form a bit later but with less activity!).
Just what i needed.
Thx man
|
|
|
|
|
Hi again
The forms with only pictureboxes work like i want, but i have some forms with lots of labels and textboxes, and they still load slow.
Is there a way to preload a form?
I dont mind waiting on a form to load, i mind that the form is loaded in pieces.
Thank you again
|
|
|
|
|
hi... someone can help me it this. i once have made a application that users login using my forum login but now i installed phpbb 3 and the password hash is not md5 anymore!!! someone can tell me how can i make the password hash for this ? i think its utf8_bin but not sure. im confused. the passwords in the database have this format -
Ex:
$H$9DL4NAPoOsmVdZpIrOJcH3KfvVoV3h1
this hash translated is - 11293045
how can i make a user autenticate is this...
thanks
this is a sample php class that does the job but dont know how to make this in vb.net
class PasswordHash {
var $itoa64;
var $iteration_count_log2;
var $portable_hashes;
var $random_state;
function PasswordHash($iteration_count_log2, $portable_hashes)
{
$this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)
$iteration_count_log2 = 8;
$this->iteration_count_log2 = $iteration_count_log2;
$this->portable_hashes = $portable_hashes;
$this->random_state = microtime() . getmypid();
}
function get_random_bytes($count)
{
$output = '';
if (($fh = @fopen('/dev/urandom', 'rb'))) {
$output = fread($fh, $count);
fclose($fh);
}
if (strlen($output) < $count) {
$output = '';
for ($i = 0; $i < $count; $i += 16) {
$this->random_state =
md5(microtime() . $this->random_state);
$output .=
pack('H*', md5($this->random_state));
}
$output = substr($output, 0, $count);
}
return $output;
}
function encode64($input, $count)
{
$output = '';
$i = 0;
do {
$value = ord($input[$i++]);
$output .= $this->itoa64[$value & 0x3f];
if ($i < $count)
$value |= ord($input[$i]) << 8;
$output .= $this->itoa64[($value >> 6) & 0x3f];
if ($i++ >= $count)
break;
if ($i < $count)
$value |= ord($input[$i]) << 16;
$output .= $this->itoa64[($value >> 12) & 0x3f];
if ($i++ >= $count)
break;
$output .= $this->itoa64[($value >> 18) & 0x3f];
} while ($i < $count);
return $output;
}
function gensalt_private($input)
{
$output = '$P$';
$output .= $this->itoa64[min($this->iteration_count_log2 +
((PHP_VERSION >= '5') ? 5 : 3), 30)];
$output .= $this->encode64($input, 6);
return $output;
}
function crypt_private($password, $setting)
{
$output = '*0';
if (substr($setting, 0, 2) == $output)
$output = '*1';
if (substr($setting, 0, 3) != '$P$')
return $output;
$count_log2 = strpos($this->itoa64, $setting[3]);
if ($count_log2 < 7 || $count_log2 > 30)
return $output;
$count = 1 << $count_log2;
$salt = substr($setting, 4, 8);
if (strlen($salt) != 8)
return $output;
# We're kind of forced to use MD5 here since it's the only
# cryptographic primitive available in all versions of PHP
# currently in use. To implement our own low-level crypto
# in PHP would result in much worse performance and
# consequently in lower iteration counts and hashes that are
# quicker to crack (by non-PHP code).
if (PHP_VERSION >= '5') {
$hash = md5($salt . $password, TRUE);
do {
$hash = md5($hash . $password, TRUE);
} while (--$count);
} else {
$hash = pack('H*', md5($salt . $password));
do {
$hash = pack('H*', md5($hash . $password));
} while (--$count);
}
$output = substr($setting, 0, 12);
$output .= $this->encode64($hash, 16);
return $output;
}
function gensalt_extended($input)
{
$count_log2 = min($this->iteration_count_log2 + 8, 24);
# This should be odd to not reveal weak DES keys, and the
# maximum valid value is (2**24 - 1) which is odd anyway.
$count = (1 << $count_log2) - 1;
$output = '_';
$output .= $this->itoa64[$count & 0x3f];
$output .= $this->itoa64[($count >> 6) & 0x3f];
$output .= $this->itoa64[($count >> 12) & 0x3f];
$output .= $this->itoa64[($count >> 18) & 0x3f];
$output .= $this->encode64($input, 3);
return $output;
}
function gensalt_blowfish($input)
{
# This one needs to use a different order of characters and a
# different encoding scheme from the one in encode64() above.
# We care because the last character in our encoded string will
# only represent 2 bits. While two known implementations of
# bcrypt will happily accept and correct a salt string which
# has the 4 unused bits set to non-zero, we do not want to take
# chances and we also do not want to waste an additional byte
# of entropy.
$itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
$output = '$2a$';
$output .= chr(ord('0') + $this->iteration_count_log2 / 10);
$output .= chr(ord('0') + $this->iteration_count_log2 % 10);
$output .= '$';
$i = 0;
do {
$c1 = ord($input[$i++]);
$output .= $itoa64[$c1 >> 2];
$c1 = ($c1 & 0x03) << 4;
if ($i >= 16) {
$output .= $itoa64[$c1];
break;
}
$c2 = ord($input[$i++]);
$c1 |= $c2 >> 4;
$output .= $itoa64[$c1];
$c1 = ($c2 & 0x0f) << 2;
$c2 = ord($input[$i++]);
$c1 |= $c2 >> 6;
$output .= $itoa64[$c1];
$output .= $itoa64[$c2 & 0x3f];
} while (1);
return $output;
}
function HashPassword($password)
{
$random = '';
if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) {
$random = $this->get_random_bytes(16);
$hash =
crypt($password, $this->gensalt_blowfish($random));
if (strlen($hash) == 60)
return $hash;
}
if (CRYPT_EXT_DES == 1 && !$this->portable_hashes) {
if (strlen($random) < 3)
$random = $this->get_random_bytes(3);
$hash =
crypt($password, $this->gensalt_extended($random));
if (strlen($hash) == 20)
return $hash;
}
if (strlen($random) < 6)
$random = $this->get_random_bytes(6);
$hash =
$this->crypt_private($password,
$this->gensalt_private($random));
if (strlen($hash) == 34)
return $hash;
# Returning '*' on error is safe here, but would _not_ be safe
# in a crypt(3)-like function used _both_ for generating new
# hashes and for validating passwords against existing hashes.
return '*';
}
function CheckPassword($password, $stored_hash)
{
$hash = $this->crypt_private($password, $stored_hash);
if ($hash[0] == '*')
$hash = crypt($password, $stored_hash);
return $hash == $stored_hash;
}
}
?>
-- modified at 12:50 Thursday 15th November, 2007
|
|
|
|
|
This forum is for asking specific VB(.NET) questions. No one is going to do your work and convert your PHP code for you. You should research the classes in the System.Security.Cryptography namespace.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
i dont need nobody to make my work, i just need someone tell where to start!!!!!
where to find some references related to this!! just that!
|
|
|
|
|
Search CodeProject, search the web. Then come back when you've got a more specific question to ask.
BTW, it's unlikely that anyone is going to understand your PHP code if you post it in a Visual Basic forum!
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Take a look at this thread on PHPBB support forum (if you haven't seen it already):
http://www.phpbb.com/community/viewtopic.php?f=71&t=585387&st=0&sk=t&sd=a[^]
I am actually working on something similar to what you are looking for, trying to translate the Hashing Class to its VB.NET equivalent. Contact me at webmaster@digioz.com and maybe we can work on it together.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Hi! I am new here so please forgive me of being a noob. I have a question though a friend and I are trying to make a new and better toolbar instead of the mac and xp one. We would like to know is it possible to keep windows made with vb.net in an absolute order
and is it possible to have three windows made into one without moving or closing the space in between? Sorry for not explaining well it's hard to describe. Anyway if you guys could help that would be great!
|
|
|
|
|
|
hi all
i want to retreave text that has COlumns from sn html page.in that html page there is a table like this,
UnitNumber|Ownwer |Title Deed|Registration_date| Purchase_Price |Details
========================================================================
1 James ST545454 20071115 $154000000 Yes
Bond .
So thats how my html looks like, so i want to retreave this data and put in in a SQL table. i have already created the table. i want to know how to do it in vb.net
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
You'll have to parse the HTML to get the values for each row. You could do this with regular expressions or with some string manipulation.
Why are you doing this though? Unless you are writing a screen-scraping application, it doesn't seem like a good idea.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi pmarfleet
Thanks for your reply
There is a website that we look at to retrieve information, but now its time consuming to do the copy and paste, we were thinking of writting a Program that will extract that info and put it in a SQl table for us.
How can we achieve this?
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I've suggested ways that you could do this. I'm not going to do your work for you. Look at how the HTML markup is constructed and then research and write a regular expression to extract the information you want.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Greetings
I have written an insert routine that has the text boxes and a grid with populated with the target "insert" table on the same form.
I am using data bindings:
txtLastName.DataBindings.Add("Text",dsMusicStore, "Customers.LastName")<br />
txtFirstName.DataBindings.Add("Text", dsMusicStore, "Customers.firstName")
Code for the insert
Dim comBuilder As New OleDb.OleDbCommandBuilder(daCustomers)<br />
Dim dsNewRow As DataRow<br />
dsNewRow = dsMusicStore.Tables("customers").NewRow<br />
dsNewRow.Item("FirstName") = txtFirstName.Text<br />
dsNewRow.Item("LastName") = txtLastName.Text<br />
dsMusicStore.Tables("customers").Rows.Add(dsNewRow)<br />
daCustomers.Update(dsMusicStore, "customers")<br />
grdCustomers.Update()<br />
Me.Refresh()
Problems:
1. When I start entering data into the textbox, the data overwrites data in the top line of the grid
2. When I save, the data in the first line is still overwritten and the new record falls to the bottom of the grid. If I close the form and reopen it, the data first line data has been restored and the new data takes its place on the grid in the proper position for the given index
How can I:
1. stop the first line on the grid from being overwrttien (short of unbinding the data
2. Update the data grid upon save so the record displays where it should (not at the bottom)
Just Do It
|
|
|
|
|
Hi all,
how to get the Full path of a Shared Network Folder.
i have a folder named DBBackup in Server Computer.
from Client computer the above path is \\Server\DBBackup.
Actually 'DBBackup' folder in D Drive of Server Computer.
i need to get this Path Like '\\Server\D\DBBackup' Or 'D:\DBBackup'.
can you give any valuable information about this.
By
George Garvasis
|
|
|
|
|
hi
When you are looking at the path of a shred folder on network it will not show on which drive is it located...
The path to the other systems will be shown as \\<system name="" system="" ip="">\<folder name="">
can u plz specify what exactly u want to do
|
|
|
|
|
Hi everyone,
In one of my project I have to work with embedded resources in VB.NET.
I have 2 Problems:
(1) In my project I have added a 5 MB movie file as a resource. Now I want to copy that one to localdisk "C:\sample.avi". I wrote the following code. But I don't know what to use in place of "x" where "x" is the path of the file to copy.
Any suggestions?
Code:
<br />
Imports System.Io<br />
<br />
Button1_click()<br />
File.copy("x","C:\sample.avi")<br />
End sub<br />
So in short I want to know what is the path of that file?
(2) How to do the same with more than one files. I want to copy them all (at least 6 files!) to localdisk. Can anyone suggest the code for it ? I will be helpful to me.
Thanks,
Dan
|
|
|
|
|
i am using .net 2005.i am doing project named as billing in vb.net 2005 windows application.i want to take printout of billing form.if i give 2 page continuosly printing,in first page correctly printed,in second page,the datas are printed at very top.i want to print in 2nd page same as 1st page.
-- modified at 5:58 Thursday 15th November, 2007
|
|
|
|
|
I want to know
how to entry data in data grid view.
And saving row by row.
|
|
|
|
|
Hi,
Please provide some more details about your requirements. Like
1. Do you want to enter data manually at run time or via code?
2. Where you want to save the data (in a database or a file)?
Looking forward to your inputs.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Hello,
I want to enter data manually at run time.
And save SQL 2005.
Thanks to your reply.
|
|
|
|
|
There is one datagrid and one textbox in my application.The datagrid is bound to the datatable.Now What I want is that when user navigate the datagrid it should show the value of datagrid first colum in textbox.
I am using the following line in the datagrid_navigate event.
textbox.text = datatable.rows(datagrid.currrowindx).item(0).tostring
But the problem is that Datagrid_Navigate event does not fire.
How I can fix this?
Thanks in advance
I am using datagrid in my application which is bound to datatable.
I am trying to use datagrid_navigate event but its not working.
Ejaz
|
|
|
|
|
Hii ,
1) How to create the no of rows ,columns at runtime by entering values of those properties (columns and rows) in propertygrid for datagridview .
2) I dont want to provide the user the facility to enter text in cells .How to disable entering text of all cells at runtime for datagridview ?
3) How can i give name for every column headerCells(which looks solid )at runtime (i.e, User cannot enter text TOP Column )for datagridview ?
4) How can i give name for every Row HeaderCells(which looks solid ) of datagridview without going into default cell while entering text ?
Actually my datagridview has to work like a flexgrid control of vb6.0
dvs
|
|
|
|
|
Hi...
I am sending you a sample code which lets you to add data at runtime... You can put all this code in a test application...
Take a form, Put a button on it and add a DataGridView. Name the DataGridView as dg and past all the following code in the form class
Inherits System.Windows.Forms.Form
Dim tab As New DataTable("MyTable")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim row As DataRow
Dim colIdx, rowIdx As Integer
'Bind
dg.DataSource = tab
For colIdx = 1 To 5
tab.Columns.Add(CType(colIdx, String))
Next
For rowIdx = 1 To 35
row = tab.NewRow()
row("1") = CType(rowIdx, String)
row("2") = "Row two" & rowIdx
tab.Rows.Add(row)
Next
End Sub
Good luck... The code is simple and works
Regards
Nishkarsh
|
|
|
|