|
Use the encoding of your choise and the GetBytes method:
messageArray = Encoding.ASCII.GetBytes("Hello world")
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
Thank you very much for help. Your code just works for ASCII characters. What about the characters in the range from 0 to 255??
Thank you again,
William
William
|
|
|
|
|
That's why I said that you should choose an encoding. Use the encoding that was used to create the string.
---
b { font-weight: normal; }
|
|
|
|
|
Dim textConverter As New System.Text.UTF8Encoding
Dim bytes() As Byte = textConverter.GetBytes("Text to convert")
Alexei Rodriguez
|
|
|
|
|
hii i am kannan.currently im working with a project in VB.Net. the project is, i've to create a reader for pdf files.the reader uploading a pdf file and user can read it like a real magazine. and we know we are flipping/turns each page of a real magazine to go for the next/Previous page. I WANT THE SAME PAGE FLIP EFFECT IN MY PROJECT.i heard that directx + vb.net wil gimme a solution.
you can see an example reader at www.zinio.com, its free for download. i need the same effect in my project. I have a components that converts each page of a pdf file to image file, which then i need to animate. Can you suggest me some idea. Is it possible using directx.
if anyone have experince in Directx + .net, lemme know it
|
|
|
|
|
Hi friends,
One problem i am stuck in please try to help.
I want to create a code where, when user clicks one row of the datagrid filled with data, the particular column value for e.g. the value of second column of the selected row should be visible on the text field present on the same form after a click of a button.
The sequence will be
1. First user click and selects one row
2. Then clicks a particular button
3. As click event is fired the value present in the second column of the selected row displays in the textbox present on the same form.
Try helping out please.
Nikhil Bandekar
Mumbai,
India
|
|
|
|
|
hi
is this windows or web application ??
Tamimi - Code
|
|
|
|
|
it is windows vb.net
i refered to the code u had given for hasan, regarding datagrid. I hope you would try to help me even. It seems you have good knowledge woking with datagrid
Nikhil Bandekar
Mumbai,
India
|
|
|
|
|
hi
put this line
TextBox1.Text = DataGrid1(DataGrid1.CurrentCell.RowNumber, 1)
on CurrentCellChanged event for thr datagrid or
on any button click
Tamimi - Code
|
|
|
|
|
hiii
Thanks a lots it worked out... I was struggling from when.
Thanks again for the favor.
Bye
Take Care
Nikhil Bandekar
Mumbai,
India
|
|
|
|
|
you are welcome
Tamimi - Code
|
|
|
|
|
I am looking to create a program similar to PcAnywhere so I can connect to various servers. I want to create an interface similar to theirs where it lists the servers that you have configured using a list view control. I want it to list the contents of the folder where I will save the configuration files and display the configuration information in the file for its respective columns.
|
|
|
|
|
That's great, do you have a question?
Mike Lasseter
|
|
|
|
|
Hi Guys
I was wondering if anyone could help me with code that loops through an application taking note of all the forms and controls that are present. Users can then dynamicall add validation rules that would be stored in a DB for example a user can select an orders form and then add a rule like specifying length of oreder number but this would be at runtime.
I want to avoid "hard coding" validations and allow users to set them up themselves.
There are 10 kinds of people in this world. Those that understand binary, and those that do not.
|
|
|
|
|
hellow to all ..
i am working on a listview and i am looking for a way to make an item on the listview not Visible , i didn't find how to do this ...
anyone have any idea ?
thxx
|
|
|
|
|
You could always set the column width equal to zero.
Mike Lasseter
|
|
|
|
|
i can't set the nodes width equal to zero ....
|
|
|
|
|
Idividual items in the ListView cannot be made visible/invisible. Using the standard controls, the only way to make an item not show up is to removed it from the list.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
yaa i know but it is bad idea when u are using the nodes number and when u move one the count get mixed up ..
|
|
|
|
|
Are there any helper tools or addin that can make it easier to analyze and understand somebody else's source code written in VB.net and C#?
Example tools might be
1) a tool that generates flow chart of which method is getting called from which method;
2) a tool that displays the call stack with ALL the values at a given stage of program execution
3) A tool that shows from where all a particular variable is being accessed, being set.
4) A tool that shows file dependencies to point out which are the BASE files to start studying.
5) Any other tools. I am sure there can be other types of tools also.
Thanks,
Rajesh.
Thanks
hiren shah
|
|
|
|
|
This might be helpful.
http://www.aivosto.com/visustin.html[^]
The free version is limited but still useful.
I think tools such as Resharper have class browsing built in. But it's not free and is C# only.
I'm sure the other guys will suggest more tools.
Kevin
|
|
|
|
|
I am trying to make the guess the number game, but now I am confised as I don't get an aswer at all at the end, I don't know where the problem is, I run it and it goes tru the code, at the end it does not give a respose at all.
I am putting persetage in for hot,warm,warem eg.
I have put in code for a aswer
Private Sub btnCheckGuess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheckGuess.Click<br />
<br />
Dim intPlayerGuess As Integer 'Declare variable to store guess<br />
<br />
Static intNoOfGuesses As Integer 'Declare variable to keep track<br />
<br />
'of the number of guesses made<br />
<br />
If txtInput.Text.Length > 0 Then 'Make sure player typed something<br />
<br />
If IsNumeric(txtInput.Text) = True Then 'Ensure input is numeric<br />
<br />
'Convert String input to Integer data type<br />
<br />
intPlayerGuess = Int32.Parse(txtInput.Text)<br />
<br />
btnCheckGuess.Enabled = True 'Enable Check Guess button<br />
<br />
'See if player’s guess is correct<br />
<br />
If intPlayerGuess = intRandomNumber Then<br />
<br />
txtInput.Text = "" 'Clear the TextBox control<br />
<br />
intNoOfGuesses += 1 'Increment variable by one<br />
<br />
'See if player enabled verbose messaging<br />
<br />
If chkVerbose.Checked = True Then<br />
<br />
txtOutput.Text = "Congratulations!" & ControlChars.CrLf & ControlChars.CrLf & "You have won the Guess a Number Game. " & ControlChars.CrLf & ControlChars.CrLf & "Number of guesses made = " & intNoOfGuesses<br />
<br />
Else<br />
<br />
txtOutput.Text = "Congratulations! You Win."<br />
<br />
End If<br />
<br />
intNoOfGuesses = 0 'Reset variable to zero<br />
<br />
txtInput.Enabled = False 'Disable TextBox control<br />
<br />
'Update the display of the total number of games won<br />
<br />
txtGamesWon.Text = txtGamesWon.Text + 1<br />
<br />
'Disable the Button labeled Check Guess<br />
<br />
btnCheckGuess.Enabled = False<br />
<br />
'Enable the Button labeled New Game<br />
<br />
btnNewGame.Enabled = True<br />
<br />
'Enable all Radio buttons<br />
<br />
rbnControl10.Enabled = True<br />
<br />
rbnControl100.Enabled = True<br />
<br />
rbnControl1000.Enabled = True<br />
<br />
'Enable the two reset buttons<br />
<br />
btnDefaults.Enabled = True<br />
<br />
btnReset.Enabled = True<br />
<br />
'Post statusbar message<br />
<br />
stbControl.Text = "Game Ready!"<br />
<br />
End If<br />
<br />
'More<br />
<br />
If (intPlayerGuess) * 100 / intRandomNumber < intRandomNumber Then<br />
<br />
answer = answer<br />
<br />
End If<br />
<br />
'Less<br />
<br />
If intPlayerGuess > intRandomNumber * 100 / intPlayerGuess Then<br />
<br />
answer = answer<br />
<br />
End If<br />
<br />
'Getting Hot<br />
<br />
If answer > 96 Then<br />
<br />
txtInput.Text = ""<br />
<br />
intNoOfGuesses += 1<br />
<br />
If chkVerbose.Checked = True Then<br />
<br />
txtOutput.Text = "You are Hot." & ControlChars.CrLf & ControlChars.CrLf & "Number of guesses taken so far = " & intNoOfGuesses<br />
<br />
Else<br />
<br />
txtOutput.Text = "Hot"<br />
<br />
End If<br />
<br />
End If<br />
<br />
'Getting warmer<br />
<br />
If answer > 80 Then<br />
<br />
txtInput.Text = ""<br />
<br />
intNoOfGuesses += 1<br />
<br />
If chkVerbose.Checked = True Then<br />
<br />
txtOutput.Text = "You are Getting Warmer." & ControlChars.CrLf & ControlChars.CrLf & "Number of guesses taken so far = " & intNoOfGuesses<br />
<br />
Else<br />
<br />
txtOutput.Text = "Warmer"<br />
<br />
End If<br />
<br />
End If<br />
<br />
'Getting warm<br />
<br />
If answer > 64 Then<br />
<br />
txtInput.Text = ""<br />
<br />
intNoOfGuesses += 1<br />
<br />
If chkVerbose.Checked = True Then<br />
<br />
txtOutput.Text = "You are Getting Warm." & ControlChars.CrLf & ControlChars.CrLf & "Number of guesses taken so far = " & intNoOfGuesses<br />
<br />
Else<br />
<br />
txtOutput.Text = "Warm"<br />
<br />
End If<br />
<br />
End If<br />
<br />
<br />
<br />
'Getting Cold<br />
<br />
If answer > 48 Then<br />
<br />
txtInput.Text = ""<br />
<br />
intNoOfGuesses += 1<br />
<br />
If chkVerbose.Checked = True Then<br />
<br />
txtOutput.Text = "You are Getting Cold." & ControlChars.CrLf & ControlChars.CrLf & "Number of guesses taken so far = " & intNoOfGuesses<br />
<br />
Else<br />
<br />
txtOutput.Text = "Cold"<br />
<br />
End If<br />
<br />
End If<br />
<br />
'Getting Colder<br />
<br />
If answer > 32 Then<br />
<br />
txtInput.Text = ""<br />
<br />
intNoOfGuesses += 1<br />
<br />
If chkVerbose.Checked = True Then<br />
<br />
txtOutput.Text = "You are Getting Colder." & ControlChars.CrLf & ControlChars.CrLf & "Number of guesses taken so far = " & intNoOfGuesses<br />
<br />
Else<br />
<br />
txtOutput.Text = "Colder"<br />
<br />
End If<br />
<br />
End If<br />
<br />
'Getting YsCold<br />
<br />
If answer > 16 Then<br />
<br />
txtInput.Text = ""<br />
<br />
intNoOfGuesses += 1<br />
<br />
If chkVerbose.Checked = True Then<br />
<br />
txtOutput.Text = "You are Getting YsCold." & ControlChars.CrLf & ControlChars.CrLf & "Number of guesses taken so far = " & intNoOfGuesses<br />
<br />
Else<br />
<br />
txtOutput.Text = "YsCold"<br />
<br />
End If<br />
<br />
End If<br />
<br />
'Correct<br />
<br />
If answer = intRandomNumber Then<br />
<br />
txtInput.Text = ""<br />
<br />
intNoOfGuesses += 1<br />
<br />
If chkVerbose.Checked = True Then<br />
<br />
txtOutput.Text = "That is it, you got it, good Work." & ControlChars.CrLf & ControlChars.CrLf & "Number of guesses taken so far = " & intNoOfGuesses<br />
<br />
Else<br />
<br />
txtOutput.Text = "You are a winner"<br />
<br />
End If<br />
<br />
End If<br />
<br />
Else<br />
<br />
txtInput.Text = "" 'Clear the TextBox control<br />
<br />
'Display error if player fails to provide numeric input<br />
<br />
If chkVerbose.Checked = True Then<br />
<br />
txtOutput.Text = "Sorry but you entered a non-numeric guess. Please try again and be sure to enter a number this time."<br />
<br />
Else<br />
<br />
txtOutput.Text = "Numeric input required. Try again."<br />
<br />
End If<br />
<br />
End If<br />
<br />
Else<br />
<br />
txtInput.Text = "" 'Clear the TextBox control<br />
<br />
'Display error if player fails to provide input<br />
<br />
If chkVerbose.Checked = True Then<br />
<br />
txtOutput.Text = "Sorry but to play you must enter a number. Please enter higher number and try again."<br />
<br />
Else<br />
<br />
txtOutput.Text = "No input provided. try again."<br />
<br />
End If<br />
<br />
End If<br />
<br />
txtInput.Focus() 'Set focus to the TextBox control<br />
<br />
End Sub
-- modified at 3:15 Monday 11th September, 2006
|
|
|
|
|
Bluärgh! Please use the pre tag when posting larger blocks of code. It's virtually unreadable in that form.
---
b { font-weight: normal; }
|
|
|
|
|
i am frm kolkata
i am working in vb.net2.0 version.
can u help me with code that how can i populate the datagridview in edit mode which will open in another form when one selects the row of a datagridview.
cheers....
Taniya Banerjee
|
|
|
|
|
hi,
At runtime i want to map keybord key to my application function
by reading text file line by line (for e.g. F1=showMessage)
"showMessage" function is there in my mdi application
Can you give me example in vb or c# .net
Thanks
hiren shah
|
|
|
|