|
Hi all,
I'm working on an application that create a file in a specified directory.
Code:
I want to create this file in a folder that was selected by the user, through FolderDialogBox.
The path is stored in TextBox1.
I want to do something like the below:
When I do the above I get the below error message:
A reference to a non-shared member requires an object reference.
Somebody help to find a solution.
Thanks in Advance.
modified 28-Nov-12 7:55am.
|
|
|
|
|
vijay2482 wrote: Somebody help to find a solution.
First you need to read a basic programming book. Even if you removed the const, this would compile but not work. You need to remove the const AND set the value when the value of the textbox is set. You also need to give your variables real names, unless you're trying to write illegible code.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for your reply.
Have used
File.Move()
to attain my requirement.
|
|
|
|
|
That obviously works, but it doesn't help that you didn't understand that setting a variable as const to read the contents of a text box, would give you it's contents on startup ( empty probably )
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Given that A, B , C and D are n x n matrices.
Write a console application to complete the following tasks:
Inputs the elements of matrix A and matrix B.
Output Matrix A and Matrix B
Output Matrix C = A + B
Output Martix D = A * B
|
|
|
|
|
You do realise that your teachers almost certainly google the text of the homework they give, so they can find lazy, good for nothing clowns like yourself, and fail you ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i need a guide line by today
|
|
|
|
|
|
fredkon wrote: Write a console application to complete the following tasks
No thanks, it serves no useful purpose.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
So do you have a question to ask or are you just posting your homework hoping that some poor sucker will do it for you?
|
|
|
|
|
B
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
This has got to be the worst attempt to get someone else to do your homework that I've ever seen.
|
|
|
|
|
you forgot to specify a time frame. Is it urgent already, or can we wait a while?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
t6he dead line is this afternoon
|
|
|
|
|
the dead line is this afternoon
|
|
|
|
|
You have no idea when sarcasm passes your way do you. Read the other posts and understand that no one here will do your homework for you. Try something and when you are stuck ask a specific question on what you have tried.
|
|
|
|
|
good.
you haven't shown any initiative, nor any code; so you should not get any help.
except for this, as I am in an exceptionally good mood right now; I picked a small part of your homework (the easiest part for sure).
Warning: I don't know much about VB.NET, and I didn't test it, however here it goes:
Dim N As Integer = 10
Dim A(N - 1, N - 1) As Integer
Dim B(N - 1, N - 1) As Integer
Dim C(N - 1, N - 1) As Integer
For I = 0 To N - 1
For J = 0 To N - 1
C(I, J) = A(I, J) + B(I, J)
Next
Next
PS: Don't bother asking me questions, it is your assignment, not mine.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
hi , i;m currently doing a project which is using GPRS modem to receive/send sms ro control the house and also a MMS function to capture a jpeg photo and send to user.
The sending /receiving sms part has done succesfully, but the problem i'm facing now is the MMS i need expert help me here...i dun know how to start with it..
i;m using VB6.0 , GPRS modem is - WT-211
i just want to create a button to send MMS and a button to choose the picture to the user , thats all. receiving MMS not in my concern
|
|
|
|
|
ericyeoh wrote: i;m using VB6.0
Why would you do such a thing ? VB6 is obsolete and has been for a long, long time. It ALWAYS was a terrible excuse for a language. Why not use a real language ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
I've never used the speech SDK, yet, 10 seconds with google, and I know that the SAPI SDK contains other voices.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: I've never used the speech SDK, yet, 10 seconds with google, and I know that the SAPI SDK contains other voices.
I understand that the Sapi SDK has other voices but I cannot find them. Any suggestions?
|
|
|
|
|
hi guys
Does anyone know how to retrieve input parameters for a website by using HTTP headers request. I mean what is the code for shown them on a textbox. I have done most of the work for sending requests and getting responses and they work very well except finding the parameters in the content. I recently use Live HTTP headers of Firefox components to get parameters but i don't want to use it any more and code my program to find them. An example, by using Live HTTP headers on google's mail , it retrieves this:
<< HTTP Header>>
POST https://www.google.com/accounts/ServiceLoginAuth?service=mail
Host: www.google.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fhl%3Den%26tab%3Dwm%26ui%3Dhtml%26zy%3Dl&bsv=zpwhtygjntrz&scc=1<mpl=default<mplcache=2&hl=en
Cookie: __utma=173272373.733204749.1223816195.1241322770.1242545301.30; __utmz=173272373.1242545301.30.18.utmccn=(referral)|utmcsr=google.co.nz|utmcct=/|utmcmd=referral; __utma=173272373.733204749.1223816195.1242545301.1255931779.31; __utmz=173272373.1255931779.30.19.utmccn=(referral)|utmcsr=google.co.nz|utmcct=/|utmcmd=referral; __utmc=173272373; GoogleAccountsLocale_session=en; __utmb=173272373; __utma=173272373.733204749.1223816195.1226208114.1227589760.4; GALX=Vq-AnFUU0sE; NID=27=JkcszjpiZcgyP2eZyPvBC5FDlr5ajSyuLl0Xryh_BmZj7nOk3du9zPjp1TPd3jSstVuloQgnbjW7PFJNPtZcM6lrPCDkuGtG--XoVNkneoXnlrkO2loAVCUnOZuNiBv_; PREF=ID=ec0ae488fdcda892:U=77ac6790d8075e61:TM=1237745195:LM=1241223529:GM=1:S=QDdvadqlCz1Tnwy0; rememberme=true; PREF=ID=455fdbe7518f0fd9:TM=1243238393:LM=1243423899:GM=1:S=PY4bydI3x1zVTkG1; GMAIL_RTT=794; TZ=-780; GMAIL_LOGIN=T1255931777004/1255931777004/1255931797099
Content-Type: application/x-www-form-urlencoded
Content-Length: 241
And the content is :
ltmpl=default<mplcache=2&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fhl%3Den%26tab%3Dwm&service=mail&rm=false<mpl=default&hl=en<mpl=default&scc=1&GALX=Vq-AnFUU0sE&Email=&Passwd=&PersistentCookie=yes&rmShown=1&signIn=Sign+in&asts=
how does it work to get the above content and how i can code my program to show them?
|
|
|
|
|
Hi all.
I am creating a program in which I am searching some files from database (MS-Access) and displaying it on Listview control.
When I am using a single form for searching and displaying then code works but I want to scan files from one form and display those items on another form, but it not working.
The code I am using is as below in frmScan:
Private Sub BGWorker_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BGWorker.DoWork
For Each file As String In My.Computer.FileSystem.GetFiles("c:\", FileIO.SearchOption.SearchAllSubDirectories)
'Check for cancelation of Background worker.
If BGWorker.CancellationPending Then
e.Cancel = True
Exit Sub
End If
Dim extn As String = IO.Path.GetExtension(file)
Try
Dim sql As String = "Select * from ThreatType"
Dim cmd As New OleDb.OleDbCommand(sql, con)
ThreatDatabase.Connect()
Dim reader As OleDb.OleDbDataReader = cmd.ExecuteReader
While reader.Read
If extn.ToUpper = reader.GetString(0) Then
If IO.Path.IsPathRooted(file) Then
Me.RefreshList(file, reader.GetString(1)) 'cross-threading
End If
End While
reader.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Next
End If
Next
End Sub
Delegate Sub UpdatetList(ByVal [Name] As String, ByVal [Type] As String)
Private Sub RefreshList(ByVal [Name] As String, ByVal [Type] As String)
If frmMain.ListView1.InvokeRequired Then
Dim d As New UpdateList(AddressOf RefreshList)
frmMain.ListView1.Invoke(d, New Object() {[Name], [Type]})
Else
frmMain.ListView1.Items.Add([Name]).SubItems.Add([Type])
End If
End Sub
In RefreshList code block, When I am using
Me.ListView1 instead of
frmMain.ListView1 then it shows file on listview of same form but I want to display files on listview of frmMain.
Suggest me how can I do this.
Thanks.
Gagan
|
|
|
|
|
Where does frmMain come from ? What do you mean by 'not working' ? What happens ? Did you want help ? You seem to be setting a puzzle rather than giving us the info we need to try to help here.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|