|
bhaps you should start with the System.Windows.Forms.SystemInformation class
I think this is what you are looking for.
Hmm...
|
|
|
|
|
Hi Lasse,
Thanks for the information, SystemInformation class has all the adequate methods which let me fetch the machines info,although what i want here is :- Machine username and also Group name. How do i fetch a usergroup name?
|
|
|
|
|
can anyone please give me sample code or example for deleting part of the string..
Dim str As String
str = "c:\temp\folder1"
how can i delete "\folder1" from str so str will be only "c:\temp"
I know how to do in c++ but do not know how to do in VB though.
Is String has any functions like CString?
in C++ i can use CString::Find('\') and CString::Right() methods.. what about in VB. any functions that will do the same as above functions???
thank you
|
|
|
|
|
I got it..
that's what i did
Dim fileName As String
Dim path As String
Dim index As Integer
path = "c:\temp\testing\folder"
path = frmPrinterProperties.IDpath.Text
' deleting the last folder name..
index = InStrRev(path, "\", -1, 1) ' find "\" reversly in the path string
path = Mid(path, 1, index) ' get what ever right before "\"
fileName = path & "new folder" ' now "c:\temp\testing\new folder"
|
|
|
|
|
Hi !
I would like to draw vertical text on my form, but don't know how to do it.
To make it clear, I dont want to do something like this :
H
e
l
l
o
W
o
r
l
d
I really want to write vertically !
Any idea how to do that ?
Thank you !
Jerome
|
|
|
|
|
You want to rotate the text 90 degs.
This is not simple
Use the Create font api (allapi.com)
CreateMyFont = CreateFont(Height,Width, 900, 900, Weight, FW_NORMAL, Italic, UnderLine, Strikeout, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH, "Times New Roman")
|
|
|
|
|
check this code:
http://www.vbcity.com/forums/topic.asp?tid=960
cheers
vasu
|
|
|
|
|
Hi,
I am getting the following error when trying to call a Windows API function from Visual Basic.NET
An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication5.exe
Additional information: Object reference not set to an instance of an object.
The code that I wrote is :
Declare Function RFVB_New Lib "RF2VB.DLL" (ByVal lObjectType As Long, ByVal pObject As Long) As Long
Dim lerror As Long
Dim lFI10Obj As Long
Public Const RFO_FAXINFO_10 = &H10000
lerror = RFVB_New(RFO_FAXINFO_10, lFI10Obj)
The error is occuring on the last line.
Please suggest the cause of the error.
Thanks
|
|
|
|
|
Refer to the following articles and see it helps:
http://www.devx.com/dotnet/articles/mh062702/Part1/mh062702-1.asp
http://www.devx.com/dotnet/articles/mh062702/Part2/mh062702-1.asp
cheers
vasu
|
|
|
|
|
Question:
I have an intranet site that I need to snag the user's domain name so I can stuff it into a mail message. Does anyone know of a way to grab this info from a serverside script?
Thanks,
-Dave W.
|
|
|
|
|
This code works in VB6, however you may be able to just wrap it into a ActiveX COM component to work on the web.
Domain Name in VB6
HTH
Nick Parker
|
|
|
|
|
hey all,
I'm trying to do a very simple regular expression but VS.NET is barking at a simple line of code.
At the top I have:
Imports System.Text.RegularExpressions
And in my code I have:
Dim r As Regex()<br />
r = New Regex("\d{2}[a-zA-Z]+", RegexOptions.IgnoreCase Or RegexOptions.Compiled)
The error message is:
C:\DavidCode\NETBeast\WindowsApplication2\Form1.vb(74): Value of type 'System.Text.RegularExpressions.Regex' cannot be converted to '1-dimensional array of System.Text.RegularExpressions.Regex'.
I'm not sure I understand why except that my regex may not be a string literal. In C# I can just do @"..." but in VB.NET it isn't working..
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
It's because of those parentheses after Dim r As Regex.
What you're saying here is "give me an array of Regexes" then you're saying assign this new Regex to this array variable which just isn't possible.
Paul
|
|
|
|
|
Thanks Paul...
Brain Fart; I keep writing things as:
Regex r = new Regex("..")
and then remembering I'm in vb.net and not adjusting properly -
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
how to create directory in VB?
I know in c++ mkdir(..).
let say i want to create c:\meme\testfolder
|
|
|
|
|
In VB6
<br />
MkDir "c:\meme\testfolder"<br />
In VB.NET
<br />
IO.Directory.CreateDirectory("c:\meme\testfolder")<br />
Paul
|
|
|
|
|
Use the
CreateDirectoryEx<code> API ;) <br />
<br />
Carlos Antollini.<br />
<a href="http://www.sonork.com/">Sonork</a> ID 100.10529 cantollini
|
|
|
|
|
We are pleased to announce the release of DeKlarit 1.2 for Microsoft Visual Studio .NET!
DeKlarit is a RAD tool that integrates into Visual Studio .NET, aimed at developers who want to rapidly deliver .NET applications. Unlike other tools with long development cycles from design to executable applications, it allows you to create robust applications in record time.
DeKlarit provides a declarative way to describe your business objects, based on which it creates and maintains a normalized schema and generates ADO.NET DataSets and DataAdapters. When there are changes in the Business Components structure, DeKlarit creates a new database schema, migrates the data from the old schema to the new one, and regenerates the .NET DataSets and DataAdapters.
Version 1.1 was released in July 2002 and added several important new features to version 1.0. Now, version 1.2 incorporates a new type of Business Component and several productivity features:
New features since v1.0:
· Reverse Engineering Tool: Start your Business Framework from an existing database and have your .NET application done in no time.
· Web Services Generator: It allows you to automatically build a Web Services layer on top of your Business Framework.
· Windows Forms Generator: It generates complete Microsoft .NET applications that work with your Business Framework.
· Custom Metadata Properties: The ability to define custom metadata properties for DeKlarit objects and attributes that can be used in custom code-generation tools.
· Event-Triggered Actions: The ability to execute actions triggered by specific events in the business rules.
· Role-Based Security: It allows you to use .NET role-based security in your Business Frameworks.
· Support for using external SQL views, with the new External View object.
· Support for paging in DataProvider’s DataAdapters
· Better Help integration and content
· Samples and documentation in Visual Basic.NET
· Improvements in the Reverse Engineering tool
· New Built-in metadata properties for Business Components and Attributes
· Performance improvements for loading large projects.
To see how easy it is to build the .NET PetShop application with DeKlarit, download it at www.deklarit.com/samples/petshop.msi.
As you can see, the DeKlarit Team has been extremely busy updating this version for our clients.
We encourage you to download the latest technical documents at www.deklarit.com/technical.
There is a 30-day limited trial version for download at www.deklarit.com/trial.
Best regards,
The DeKlarit Team
www.deklarit.com
info@deklarit.com
|
|
|
|
|
No, two!
I really would want a Web Services Generator which allows me to automatically build a Web Services layer on top of my Business Framework!
And the ability to define custom metadata properties for DeKlarit objects is making me die for it!
DeKlarit wrote:
Reverse Engineering Tool
How creative! And I bet it works!
DeKlarit wrote:
As you can see, the DeKlarit Team has been extremely busy updating this version for our clients.
Wow!
Can you answer me a doubt I have ? Does Bill Sergio work for your company ?
Concussus surgo.
When struck I rise.
|
|
|
|
|
Take your spam elsewhere.
Or better yet buy ad space on CP.
Bruce Duncan, CP#9088, CPUA 0xA1EE, Sonork 100.10030 'ugly naked women are good, when i'm not around, in front of someone else' - Shog9
|
|
|
|
|
VBA module
Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End Type
Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXsize As Long
dwYsize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Declare Function CloseHandle Lib "kernel32" (hObject As Long) As Boolean
Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hObject As Long, ByRef dwExitCode As Long) As Boolean
Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Declare Function CreateProcessA Lib "kernel32" (ByVal lpApplicationName As Long, ByVal lpCommandLine As String, ByVal lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
'Public Sub ShellAndWait(AppToRun)As Integer
Function ShellAndWait(AppToRun) As Integer
Dim NameOfProc As PROCESS_INFORMATION
Dim NameStart As STARTUPINFO
Dim rc As Long
Dim dwExitCode As Long
dwExitCode = -1
ShellAndWait = dwExitCode
NameStart.cb = Len(NameStart)
rc = CreateProcessA(0&, AppToRun, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, 0&, NameStart, NameOfProc)
rc = WaitForSingleObject(NameOfProc.hProcess, INFINITE)
rc = GetExitCodeProcess(NameOfProc.hProcess, dwExitCode)
MsgBox "ExitCode for the process is, dwExitCode = " & dwExitCode
ShellAndWait = dwExitCode
rc = CloseHandle(NameOfProc.hProcess)
End Function
|
|
|
|
|
Try this (Need Script Host 5.5+):
Sub ShellAndWait(AppToRun)
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Shell.Exec( AppToRun )
End Sub
YVOTD: 15 "The eyes of the Lord are on the righteous and his ears are attentive to their cry;
16 the face of the Lord is against those who do evil, to cut off the memory of them from the earth. " - Psalm 34:15-16 (1 Peter 3:11-12) (NIV)
|
|
|
|
|
Hello,
I've got these 2 lines of code, they each do the same thing, but one produces VERY different results. Can someone please tell me what is going on. It is simple painting code. In a user control, I overrided the onpaint event. The 2 drawing calls inside are practically the same, and produce the same effect on the control. HOWEVER, when you resize the form so the form border clips half of the usercontrol, it creates speckles on the control when you move the form off the control slowly. Take a look:
BTW, my usercontrol is inherited from system.windows.forms.button
<br />
Protected Overrides Sub OnPaint(ByVal pevent As System.Windows.Forms.PaintEventArgs)<br />
MyBase.OnPaint(pevent)<br />
Dim p As New Pen(Color.Navy)<br />
p.DashStyle = Drawing.Drawing2D.DashStyle.Dot<br />
<br />
With Me<br />
'THIS CODE SPECLES FUNNY<br />
pevent.Graphics.DrawRectangle(p, 4, 4, .Width - 10, .Height - 10)<br />
<br />
' - OR -<br />
<br />
'THIS CODE WORKS JUST FINE<br />
'ControlPaint.DrawFocusRectangle(pevent.Graphics, New Rectangle(4, 4, .Width - 10, .Height - 10))<br />
<br />
End With<br />
End Sub<br />
Can Someone Please Please let me know, because I am trying to implement a "focus rectangle", but I don't want to use ControlPaint.Draw.... because I need color customization and ControlPaint.Draw... Doesn't have working color customization.
Thanks,
ERIC FRANZ
|
|
|
|
|
hi, i still dont understand the concept of "stream", more specifically:
System.IO.Stream
System.IO.MemoryStream
Here's a code fragment in VB.NET:
Dim HSBCWC As new Customer()
HSBCWC.ID = 08346
HSBCWC.FirstName = "Paul"
HSBCWC.LastName = "Bowie"
...
Dim stream As MemoryStream()
Dim serializer As New XmlSerializer( Customer.GetType() )
serializer.Serialize( stream, HSBCWC ) QUESTION 1: Why not serialize to a string as supposed to a MemoryStream? It would be much simpler rite?
...
stream.Flush() QUESTION 2: I dont understand why we need to flush? flush what from what? I thought HSBCWC has already been "flushed" to stream?
stream.Seek(0,SeekOrigin.Begin) however, I do understand why u need to Seek (rewind the stream).
...
Dim reader As New StreamReader(stream)
message.body = reader.ReadToEnd()
stream.Close()
SmptMail.Send(message)
I'm a newbie and pretty confused why we need "streams" in general.
help!
SHAME
|
|
|
|
|
"The MemoryStream class creates streams that have memory as a backing store instead of a disk or a network connection."
I thought MemoryStream is a memory object (data in RAM). So, "Flush" will flush this data (already in memory) to another memory location???
help!
norm
|
|
|
|
|