|
hmmm.. why dont you look at using wnetaddconnection first to create a connection to each other machine in turn (for which you'll need the userid and password on each machine) and then copy to/thru that ... then use wnetcancelconnection when done
although this is c#, you can use the same idea :-
http://www.codeproject.com/KB/system/Map_Network_folder_UNC_.aspx[^]
(else, you could permanently map a connection from each machine to your source machine, but thats a bit inflexible)
oh, if you go along the first route, maybe you want to store each machine's credentials in encrypted form (and maybe have a common userid/password on each for this task)
hth
'g'
|
|
|
|
|
Since you're using workgroup mode to do your networking, each machine maintains its own user/password database and does NOT trust the ID's in any other machines user database. This means you have no choice but to specify a username and password for each machine your going to copy files to. If these machines were setup in a domain environment, this wouldn't be a problem at all since all the machines in the domain trust the same user database.
There is no code that will solve this problem for you.
|
|
|
|
|
Thanks Lloyd Atkinson for your suggestion but it is not a proper answer for me.
I want to open a text file by right clicking on it,choosing 'open with' option,and selecting my program.
I want to open text file as 'open with' my program instead of executing my program and then opening texe file.
Plz help me...
|
|
|
|
|
|
Oh I see what you mean now, you will just have to register your file type in the registry like Eslam Afifi said.
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
I look at Microsoft, and turn to my poster on the wall saying: "Bang head here in case of stress".
|
|
|
|
|
|
Well, what do you mean? Are you incapable of reading the comments in the code?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I am not incapable of reading the comments because they have been written by myself. I think you didn't understand the question all i was asking the technical working what is happening in the memory when we execute the given code.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
AliAmjad wrote: you didn't understand the question
Well, it was so off worded, do you really expect anyone to understand?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Not sure what you are asking here. Are you asking for guidance on interfaces?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Ok here is what i am trying to accomplish i am working on an Application Framework and using both the composition approach and inheritance approach all i was asking the technical working of the code given what is actually happening in the memory as there is some confusion i am facing that's why asking.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
WHAT THE HELL ! when someone don't understand the question he/she mark it as bad question. You all guys are expert out there i am sure but i don't consider myself one that's why i was asking for help from all the experts & brilliant brains out there in order to eliminate the confusion i am facing. If by asking something that hurts your ego or that's way too below your expectation then please don't even bother to answer just IGNORE.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
Your question, as worded, implies that you don't know anything about how to declare a variable or create an instance of a class. This is VB.NET 101 type stuff, which is probably why you got knocked down.
The answer to the question at hand is quite simple. Memory is allocated to hold an instance of the object, both the code and data seperately. The code is only kept in memory once for every instance of the class, while each instance's data is kept seperately in their own blocks of memory.
If you wanted to know something beyond this, perhaps an explanation of what you're thinking is going on, or what the situation is you're facing, or why you're looking for more detail would be in order.
|
|
|
|
|
I know all this but may be i am not able to ask the question properly or you are not getting my point anyway thanks a ton for your help Dave.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
Dave Kreskowiak wrote: perhaps an explanation of what you're thinking is going on, or what the situation is you're facing, or why you're looking for more detail would be in order.
Yes, that would be very nice.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I am completely off the road i think if i can rephrase the question should i ask - How memory is allocated to an object in Heap? If you came across any technical article on this topic please let me know Thanks.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
AliAmjad wrote: How memory is allocated to an object in Heap?
Yes, that would have helped alot.
|
|
|
|
|
AliAmjad wrote: Dim nyBus As ICalculateTax = New NewYorkBusiness
An instance of the NewYorkBusiness class (I suppose that it's a class) is created on the heap. The reference to the instance is stored in the nyBus variable. The nyBus variable can hold a reference to any class that implements the ICalculateTax interface.
AliAmjad wrote: Dim nyBus As BasicBusiness = New LahoreBusiness
An instance of the LahoreBusiness class is created on the heap. The reference to the instance is stored in the nyBus variable. The nyBus variable can hold a reference to the BasicBusiness class or any class that inherits it.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Im trying to print to a 40 column printer through my VB Application. But the printer instead of printing it will keep showing Spooling status. Im Using Epson TM-U220PD Printer, VB 6.0 and Sql Server 2000 as Backend. Anybody plz help me out in this context. I need to solve this urgently...
Here is my code...
sql = "select * from ReportTable"
If rstemp.State = 1 Then rstemp.Close
rstemp.Open sql, con, adOpenStatic, adLockOptimistic
If rstemp.EOF = False Then
'Open "LPT1" For Output As #intFreeFile
Open App.Path & "\reports\Billing.txt" For Output As #1
Printer.Print ""
Printer.FontName = "Arial"
Printer.FontBold = False
Printer.FontSize = 8
Print #1, vbTab & Trim(rstemp!CompanyName)
Print #1, vbTab & Trim(rstemp!BranchName)
Print #1, Space(1) & Trim(rstemp!Address) & Trim(rstemp!Street)
Print #1, vbTab & Trim(rstemp!City) & "," & Trim(rstemp!Phone)
Print #1, Space(1) & "CST No:" & Space(1) & Trim(rstemp!CATName) & Space(2) & "KST No:" & Space(1) & Trim(rstemp!DeptName)
Print #1, Space(1) & "TIN No:" & Space(1) & Trim(rstemp!VATNo)
Print #1, "-------------------------------------"
Print #1, " CASH BILL "
Print #1, "-------------------------------------"
Print #1, "M/s: " & Trim(rstemp!EANCode)
Print #1, "BillNo: " & Trim(rstemp!slno)
Print #1, "Bill Dt: " & Trim(rstemp!a1Date) & Space(3) & "Time: " & Right(Trim(rstemp!a2date), 12)
Print #1, "-------------------------------------"
Print #1, "SN" & Space(1) & "Desc." & vbTab & Space(4) & "Qty" & Space(2) & "Rate" & Space(4) & "Amt"
Print #1, "-------------------------------------"
slno = 1
totitem = 0
totamt = 0
Do Until rstemp.EOF
If Len(rstemp!ItemName) <= 14 Then
Print #1, Space(1) & Trim(slno) & Space(1) & Trim(rstemp!ItemName) & Space(14 - Len(Trim(rstemp!ItemName))) & Space(3) & Trim(rstemp!Qty) & Space(3 - Len(Trim(rstemp!Qty))) & Space(2) & Trim(Format(rstemp!sp, "#0.00")) & Space(6 - Len(Trim(rstemp!sp))) & Space(2) & Trim(Format(rstemp!amount, "#0.00"))
totitem = totitem + Val(rstemp!Qty)
totamt = totamt + Val(rstemp!amount)
Else
str1 = Trim(Left(rstemp!ItemName, 14))
str2 = Trim(Mid(rstemp!ItemName, 15, 40))
Print #1, Space(1) & Trim(slno) & Space(1) & Trim(str1) & Space(14 - Len(Trim(str1))) & Space(3) & Trim(rstemp!Qty) & Space(3 - Len(Trim(rstemp!Qty))) & Space(2) & Trim(Format(rstemp!sp, "#0.00")) & Space(6 - Len(Trim(rstemp!sp))) & Space(2) & Trim(Format(rstemp!amount, "#0.00"))
totitem = totitem + Val(rstemp!Qty)
totamt = totamt + Val(rstemp!amount)
End If
slno = slno + 1
rstemp.MoveNext
Loop
Print #1, "-------------------------------------"
Print #1, " Total : " & Trim(totitem) & Space(3) & Trim(Format(totamt, "#0.00"))
Print #1, "-------------------------------------"
Print #1, "Some text goes here"
Print #1, "Goods once sold will not be exchanged or "
Print #1, "taken back. "
Print #1, "Some text goes here"
Print #1, "Some text goes here"
Print #1, "Some text goes here"
'Ejecting the page
Print #1, Chr$(12);
'Releasing the printer
Print #1, Chr$(27); "q";
Close #1
Else
'Do Nothing
End If
rstemp.Close
|
|
|
|
|
praveenhathwar wrote: I need to solve this urgently...
That's your own problem, then. This site is not for people with urgent needs. Members will post on their own free time, when and if they do feel like it.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hello everybody,
I have a big issue that I can't seem to be able to solve. I need to find a SINGLE CPU process (one program that I know the name of), and display it into a label.
For example My_program ---> 20%
I use (on a timer)
Private m_PerformanceCounter As New System.Diagnostics.PerformanceCounter("Processor", "% Processor Time", "_Total")
ListBox1.Items.Add(CInt(m_PerformanceCounter.NextValue()) & "%")
but I think I get ALL processes added up. I just want ONE of them
for example (in pseudocode)
if process.name = "My_program" then label1.text=process.CPUUsageTimeOfTHatProcess
How can I do it with VB.NET? Any help will be much appreciated. Thank you in advance.
Still trying to find the way
|
|
|
|
|
Of course it's returning the total CPU usage. Look at the line of code your using:
Chaos Machine wrote: Private m_PerformanceCounter As New System.Diagnostics.PerformanceCounter("Processor", "% Processor Time", "_Total")
On top of this, you don't even need the Performance counters to do this. You can get a processes CPU time using the process' Process object. Checkout the Process class[^] and it's TotalProcessorTime and UserProcessorTime properties.
|
|
|
|
|
Hi All,
I posted this under XML but after reading some of the other posts, it was probably the wrong message board so here it is.
OK I have worked out the below code to return the 'EN' string if I supply the string code, say "1000" of the below XML file but what I need to know is how to search for the string and return the string code. If I could use a wildcard in this it would be great.
Any Thoughts???
Private Sub XPathSearch(ByVal XMLPath As String)
Dim xmlNI As XPathNodeIterator
Dim xpathDoc As XPathDocument
Dim xmlNav As XPathNavigator
Try
xpathDoc = New XPathDocument(XMLPath)
xmlNav = xpathDoc.CreateNavigator()
xmlNI = xmlNav.Select("/MOMLANG/STRING[@code='" & stringValue & "']/LANG[@code='EN']")
While (xmlNI.MoveNext())
'Me.RichTextBox1.AppendText(xmlNI.Current.Name + " : " + xmlNI.Current.Value & vbCrLf)
Me.RichTextBox1.AppendText("String value: " + xmlNI.Current.Value & vbCrLf)
End While
Catch ex As XPathException
System.Console.WriteLine("XMLException: " + ex.Message)
Catch ex As Exception
System.Console.WriteLine("Exception: " + ex.Message)
End Try
End Sub
I have worked with reading simple XML elements but have not worked with atributes and the like. I am also new to both XML and Dev in general.
I have read several articles but most give me examples for reading simple XML e.g.
<person>
<firstname>John</firstname>
<lastname>Smith</lastname>
</person>
The file I am trying to read is below, any help would be great and examples are very much welcome. My goal for the GUI in VB.NET will be to have a textbox to enter string number I am searching for and a dropdown but to select the language.
Regards
Jason
<momlang>
<string code="2000">
<lang code="AR">Access Allowed List</lang>
<lang code="CZ">Access Allowed List</lang>
<lang code="DE">Access Allowed List</lang>
<lang code="DK">Access Allowed List</lang>
<lang code="EE">Access Allowed List</lang>
<lang code="EN">Access Allowed List</lang>
<lang code="ES">Lista de accesos permitidos</lang>
<lang code="FI">Pääsylista sallitut</lang>
<lang code="FR">Liste des accès autorisés</lang>
<lang code="GB">Access Allowed List</lang>
<lang code="HU">Hozzáférés Engedély Lista</lang>
<lang code="IT">Elenco accessi consentiti</lang>
<lang code="NL">Access Allowed List</lang>
<lang code="NO">Liste over systemtilgang</lang>
<lang code="PL">Access Allowed List</lang>
<lang code="RU">Access Allowed List</lang>
<lang code="SE">Använda tillåten lista</lang>
</string>
<string code="10000">
<lang code="AR">المطبوعة:</lang>
<lang code="CZ">Vytisknuto:</lang>
<lang code="DE">Gedruckt:</lang>
<lang code="DK">Printed:</lang>
<lang code="EE">Prinditud:</lang>
<lang code="EN">Printed:</lang>
<lang code="ES">Impreso:</lang>
<lang code="FI">Tulostettu:</lang>
<lang code="FR">Imprimé:</lang>
<lang code="GB">Printed:</lang>
<lang code="HU">Nyomtatott:</lang>
<lang code="IS">Printed:</lang>
<lang code="IT">Stampato:</lang>
<lang code="NL">Afgedrukt:</lang>
<lang code="NO">Skrevet ut</lang>
<lang code="PL">Wydrukowano:</lang>
<lang code="RU">Ðапечатано:</lang>
<lang code="SE">Utskrivet:</lang>
</string>
</momlang>
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
I want to control (get/set) the volume level of master/wave/mic of a soundcard using VB.2008.
Where can I find a sample file or more information.
Me kiter
|
|
|
|
|