|
You can get the type by using
Type t = GetType(System.String)
|
|
|
|
|
Hi,
Yes but I get the type in string format as "System.Double". How can I type cast it as
Type t = GetType("System.Double") is it ok? or any other method. Please help me.
Thanks,
Aleem Mohammad,
NIIT technologies
abdul.aleem@niit-tech.com
|
|
|
|
|
Hi All,
I got it, its Type.GetType("System.Double").
Thanks to all of you who tried to help. Thanks a lot.
Aleem Mohammad.
NIIT technologies
abdul.aleem@niit-tech.com
|
|
|
|
|
There is no reason to send the type to the method.
It can use value.GetType() to get the actual type of the parameter, and this also prevents the situation where you send data as one type and the type information to be something different.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
GetType(String)
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
Under is some code of C#, i would like all of you to show me how can to VB.net because i don't know C# at all and i don't know this code as well.
Thanks for your help...
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
allStands = new List[] { Stand1plates, Stand2plates, Stand3plates };
// Stand2plates.Add(3);
}
List[] allStands;
List Stand1plates = new List();
List Stand2plates = new List();
List Stand3plates = new List();
private void MoveFromTo(int source, int dest)
{
int top = allStands[source-1][allStands[source-1].Count - 1];
allStands[source - 1].Remove(top);
allStands[dest-1].Add(top);
RedrawPanels();
}
=================================
I change it to VB.net as bellow:
Public Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
' Stand2plates.Add(3);
allStands = New List() {Stand1plates, Stand2plates, Stand3plates}
End Sub
Private allStands As List(Of Integer)
Private Stand1plates As New List(Of Integer)
Private Stand2plates As New List(Of Integer)
Private Stand3plates As New List(Of Integer)
Private Sub MoveFromTo(ByVal source As Integer, ByVal dest As Integer)
Dim top As Integer = allStands(source - 1)(allStands(source - 1).Count - 1)
allStands(source - 1).Remove(top)
allStands(dest - 1).Add(top)
RedrawPanels()
End Sub
End Sub
but it has error where underline. what's problem ? How do i change it ?
Thanks for your helps.
VB.Net
|
|
|
|
|
Sovann wrote: i don't know C# at all and i don't know this code as well.
God bless you.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
1: next time post the error you get
2: before you post here read the error
to few arguments to ... paints a pretty clear picture of what is wrong
3: to solve this
change 'private allstands as list(of integer)' to 'private allstands as list(of list(of integer))
and in the constructor (public sub new in case you do not know)
put the following:
allStands = New List(Of List(Of Integer))
allStands.Add(Stand1plates)
allStands.Add(Stand2plates)
allStands.Add(Stand3plates)
this should work
|
|
|
|
|
Arrrggghhh! This code won't go away!
|
|
|
|
|
I am working with the macros in Microsoft Project. I come accross some issues while using event handlers. within the open_project event handler, I want to store some "task" information in memory. I will then make changes in project file (by adding, modifying tasks) manually. And within the save_project event handler, I want to use already stored "tasks" information . it seems I'll have to use in-proc dlls for preserving the values and using them whenever required. Can any one please suggest me what to do !
Madni
|
|
|
|
|
Hi,
I need to create a windows application which will have to run in background and will capture the web site address entered by the user in that machine. ie I need to monitor the usage of internet in a machine.
I would like to know the details of the namespace and the method used for capture details of the visited sites.
Thanks
Yesuprakash
Cochin
|
|
|
|
|
|
Hiii
I want to insert new row in data grid view and set the cursor in new inserted rows first cell.
Please suggest.
Thanx
~Khatri Mitesh
|
|
|
|
|
Hi all,
I have write a simple code to read a text file containing Chinese and English characters, however, it returns unexpected result.
my codes are as follows:
Dim oFile As System.IO.File
Dim oRStrm As System.IO.StreamReader
Dim line As String
oRStrm = New System.IO.StreamReader(filepath_in, System.Text.Encoding.Unicode)
Do
line = oRStrm.ReadLine
If Not line Is Nothing Then
Me.txtContent.Text = Me.txtContent.Text & vbCrLf
Else
Exit Do
End If
Loop
Please comments.
Many thanks
|
|
|
|
|
So what is the problem - unexpected results, are we supposed to guess what they are. Oh I know telepathic software, been working on that for some time, haven't quite got it right.
Whats the error and what do you expect to see.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
1st of all, Thanks for your reply.
Getting back to the problem, supposingly, my text file contains "一abc中文" only this line of words.
It should return the same words. But now the outcome is "䂤扡ꑣ꒤", you may see some strange characters here. It's really frustrating me.
Thanks again for ur help.
|
|
|
|
|
I would guess, and it really is a guess, that one of your objects does not support unicode under the current initialisation, possibly the textbox. Another idea, do you have the character set installed.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hm...actully, just read returned text by streamreader already found the text is wrong...sigh..., but thanks for your idea.
|
|
|
|
|
You are reading the file as UTF-16. Is it really encoded using that encoding?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi i've created a few user defined controls in my project which i had seperately added in a folder named User Control Folder. When i tried to add a new User Control in my project through add> user control on clicking User Control Folder i got the error message as:
"No Visual Studio template information found. See the application log in Event Viewer for more details.
To open Event Viewer, click Start, click Control Panel, double-click Administrative Tools, and then double-click Event Viewer."
when i clicked ok then i got a window which has only two options as inherited form & inherited UserControl
when i select inherited User Contol and press OK i get the Error Message as :
"Error HRESULT E_FAIL has been returned from a call to a COM component."
and also no contol added to my project
Please Help...
|
|
|
|
|
Hi All,
I have a question I want to append Value="0" string into a string
as below
Dim str as String
str="<parameters">
str = str + "Value=??????
how should I do it to make it look as below
<parameters value="0" type="Double">
as this. Like I need to use escape character but in VB.Net escape character is " only so pls. give me a sample code snippet how to use it.
Thanks,
Aleem Mohammad
Senior S/W Engineer
NIIT technologies
abdul.aleem@niit-tech.com
|
|
|
|
|
Double them:
Dim LstrSting As String
LstrSting = "Manas Bhardwaj"
LstrSting = LstrSting + "Value=""0"""
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi,
Thanks for the answer but if I want to add a variable value with it
Like
Dim name as String = "Sample"
Dim LstrSting As StringLstrSting = "Manas Bhardwaj"
LstrSting = LstrSting + "Value=""0"""
LstrSting=LstrSting + """" + name + """"
how? As I need it should look like the below
<value name="Sample" ----it="" should="" look="" like="" mode="hold">
Thanks,
Aleem Mohammad.
NIIT technologies
abdul.aleem@niit-tech.com
|
|
|
|
|
Well, your code would work...but just a suggestion, using String.Format is always nice as it makes your code more readable...
Dim LstrSting As String
Dim name As String = "Indian143"
LstrSting = "Manas Bhardwaj"
LstrSting = String.Format("{0}""{1}""", LstrSting, name)
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
indian143 wrote: how should I do it to make it look as below
I don't see anything below.
Use the "Ignore HTML" option when you are posting markup code.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|