|
what actuall you want is it you want 0.000000001 or 1E-9
explain clearly
|
|
|
|
|
I want this just to display on the screen.
|
|
|
|
|
how do you convert ?
please give the code...
did you try with s = a.ToString() ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi,
How can I create a network share using .net code? I've search every forum and articles that i can find on the internet but still didn't came to any solution that suited for me. I'm creating a simple application that create a folder and share the folder to the network and unshare the previous folder with the same network sharename
|
|
|
|
|
There is nothing in the .NET Base Class Library that will do this. You need to either P/Invoke the appropriate Win32 API functions to setup the Share and appropriate rights or you can do it using WMI and the System.Management namespace.
I don't have any code to share with you because I've never had to do it. You could look at
this[^] WSH scripting, using WMI, that does approximately what you want. You could use this as a template to create your own code in VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the link. I'll try the script...
|
|
|
|
|
Hello. I am portuguese, sorry if my english isn't good.
I have a Datagrid. I want to use the keyDown event to reconize one key. But I have no luck at all. The problem is that the keydown event won't fire at all, unless I click on a row (withs will be selected) and then click on it again. Now if I press any key the event will fire.
When a row is selected i want that if one key is pressed the data in the row selected go for another form.
waiting for your help...
Thanks.
|
|
|
|
|
hi,
create custom table styles for that datagrid and then check it out
|
|
|
|
|
It works fine. Thanks.
|
|
|
|
|
I have several *.config files located in various directories. Some of the *.config files contain lines similar to this:
add key="Raw Data Quality = " value="0"
add key="Raw Data Justification = " value="Component quality is good and was constructed from good data."
add key="Data Completeness = " value="-1"
add key="Data Completeness Justification = " value="This should be written out in the Non-Zero report."
I’m trying to extract all non-zero value s, and print (to a new line in a text file) the key of the non-zero and the value of the key on the next line.
Like this:
Data Completeness = -1: This should be written out in the Non-Zero report.
I apologize for asking such a broad question. I’ve spent hours trying to figure out how to write the *.config file and now I can’t seem to find out how to read this format back out to a text file.
Thanks
Brad
|
|
|
|
|
|
Hey ppl, I have ported this code from a vb6 example, but can't seem to get it working... Any ideas
<br />
Private Class TitleBarInfo<br />
<System.Runtime.InteropServices.DllImport("user32")> Shared Function GetTitleBarInfo(ByVal hwnd As IntPtr, ByRef pti As TITLEBARINFO) As Boolean<br />
End Function<br />
<br />
<br />
Private Const STATE_SYSTEM_FOCUSABLE As Integer = &H100000<br />
Private Const STATE_SYSTEM_INVISIBLE As Short = &H8000S<br />
Private Const STATE_SYSTEM_OFFSCREEN As Integer = &H10000<br />
Private Const STATE_SYSTEM_UNAVAILABLE As Short = &H1S<br />
Private Const STATE_SYSTEM_PRESSED As Short = &H8S<br />
Private Const CCHILDREN_TITLEBAR As Short = 5<br />
Public Structure RECT<br />
Public left As Integer<br />
Public top As Integer<br />
Public right As Integer<br />
Public bottom As Integer<br />
End Structure<br />
Public Structure TITLEBARINFO<br />
Public cbSize As Integer<br />
Public rcTitleBar As RECT<br />
<VBFixedArray(CCHILDREN_TITLEBAR)> Public rgstate() As Integer<br />
Public Sub Initialize()<br />
ReDim rgstate(CCHILDREN_TITLEBAR)<br />
End Sub<br />
End Structure<br />
Public Shared Function GetTitleBarInfo(ByVal Handle As IntPtr) As TITLEBARINFO<br />
Dim TitleInfo As TITLEBARINFO<br />
'Initialize structure<br />
TitleInfo.Initialize()<br />
TitleInfo.cbSize = Len(TitleInfo)<br />
<br />
GetTitleBarInfo(Handle, TitleInfo)<br />
return TitleInfo<br />
Return TitleInfo<br />
End Function<br />
End Class<br />
|
|
|
|
|
Private Structure TITLEBARINFO
Dim cbSize As Integer
Dim rcTitleBar As RECT
<VBFixedArray(CCHILDREN_TITLEBAR + 1)> _
Dim rgstate() As Integer
Public Sub Initialize()
ReDim rgstate(CCHILDREN_TITLEBAR + 1)
End Sub
End Structure
and
GetTitleBarInfo(Me.Handle.ToInt32, TitleInfo)
hope this helps
|
|
|
|
|
Sorry AndrewVos,
I sent that last message to fast, I checked it again and I was still getting a error 87, sorry.
add this import:
Imports System.Runtime.InteropServices
and the structure should be more like this:
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> _
Private Structure TITLEBARINFO
Dim cbSize As Long
Dim rcTitleBar As RECT
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=CCHILDREN_TITLEBAR)> _
Dim rgstate() As Long
Public Sub Initialize()
ReDim rgstate(CCHILDREN_TITLEBAR)
End Sub
End Structure
It should return err code 0 now.
hope that helps
|
|
|
|
|
Still not working... The elements of rgstate() are all = 0.
Consider this code....
<br />
Private Class TitleBarInfo<br />
<System.Runtime.InteropServices.DllImport("user32")> Private Shared Function GetTitleBarInfo(ByVal hWnd As IntPtr, ByRef pti As TITLEBARINFO) As Boolean<br />
End Function<br />
<br />
Private Const STATE_SYSTEM_FOCUSABLE As Integer = &H100000<br />
Private Const STATE_SYSTEM_INVISIBLE As Short = &H8000S<br />
Private Const STATE_SYSTEM_OFFSCREEN As Integer = &H10000<br />
Private Const STATE_SYSTEM_UNAVAILABLE As Short = &H1S<br />
Private Const STATE_SYSTEM_PRESSED As Short = &H8S<br />
Private Const CCHILDREN_TITLEBAR As Short = 5<br />
Public Structure RECT<br />
Public left As Integer<br />
Public top As Integer<br />
Public right As Integer<br />
Public bottom As Integer<br />
End Structure<br />
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> Private Structure TITLEBARINFO<br />
Dim cbSize As Integer<br />
Dim rcTitleBar As RECT<br />
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=CCHILDREN_TITLEBAR + 1)> Dim rgstate() As Integer<br />
Public Sub Initialize()<br />
ReDim rgstate(CCHILDREN_TITLEBAR + 1)<br />
End Sub<br />
End Structure<br />
<br />
Private Shared Function GetTitleBarInfo(ByVal Handle As IntPtr) As TITLEBARINFO<br />
Dim TitleInfo As TITLEBARINFO<br />
'Initialize structure<br />
<br />
TitleInfo.Initialize()<br />
TitleInfo.cbSize = Len(TitleInfo)<br />
<br />
' GetTitleBarInfo(Handle, TitleInfo)<br />
GetTitleBarInfo(Handle, TitleInfo)<br />
'Show some of that information<br />
Return TitleInfo<br />
End Function<br />
<br />
<br />
Public Shared ReadOnly Property CaptionButtonCount(ByVal Handle As IntPtr) As Integer<br />
Get<br />
Dim count As Integer<br />
<br />
Dim tbi As TITLEBARINFO<br />
tbi = GetTitleBarInfo(Handle)<br />
<br />
'Index TitleBar Element<br />
'0 The title bar itself. <br />
'1 Reserved. <br />
'2 Minimize button. <br />
'3 Maximize button. <br />
'4 Help button. <br />
'5 Close button. <br />
Dim x As Integer<br />
For x = 2 To 5<br />
If Not (tbi.rgstate(x) = STATE_SYSTEM_INVISIBLE) And Not tbi.rgstate(x) = 0 Then<br />
count += 1<br />
End If<br />
Next x<br />
Return count<br />
End Get<br />
End Property<br />
<br />
End Class<br />
<br />
|
|
|
|
|
MSDN on the GetTitleBarInfo function.....
"If the function succeeds, the return value is nonzero."
|
|
|
|
|
Yeah, I been tweaking the code for a while now with no luck, anyone with a good understanding of interop, please comment, thanks.
|
|
|
|
|
AndrewVos,
Sorry, I was woring on it between other code so it didn't get my full attention or time, I think this solution should work now that I've had time to see what was going on. It works on my end.
'----------------------------------------
Imports System.Runtime.InteropServices
'----------------------------------------
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> _
Structure Rect
Public rLeft, rTop, rRight, rBottom As Int32
Public Function ToRectangle() As Rectangle
Return Rectangle.FromLTRB(rLeft, rTop, rRight, rBottom)
End Function
Public Overrides Function ToString() As String
Return "Rect: " & ToRectangle.ToString
End Function
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> _
Structure TitleBarButtonStates
Public TitleBarState As TBBStates
Public Reserved As TBBStates
Public MinState As TBBStates
Public MaxState As TBBStates
Public HelpState As TBBStates
Public CloseState As TBBStates
End Structure
Enum TBBStates
STATE_SYSTEM_UNAVAILABLE = &H1
STATE_SYSTEM_PRESSED = &H8
STATE_SYSTEM_INVISIBLE = &H8000
STATE_SYSTEM_OFFSCREEN = &H10000
STATE_SYSTEM_FOCUSABLE = &H100000
End Enum
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> _
Public Structure TITLEBARINFO
Dim cbSize As Int32
Dim rcTitleBar As Rect
Dim rgstate As TitleBarButtonStates
End Structure
Private Declare Function GetTitleBarInfo Lib "user32.dll" ( _
ByVal hwnd As Int32, ByRef pti As TITLEBARINFO) As Long
Public Shared Function GetTitleBarInfo(ByVal Handle As Int32) As TITLEBARINFO
Dim TitleInfo As TitleBarInfo
'Initialize structure
TitleInfo.cbSize = Len(TitleInfo)
GetTitleBarInfo(Handle, TitleInfo)
' *debug* the information we got back
With TitleInfo.rcTitleBar
System.Diagnostics.Debug.WriteLine(" (" & CStr(.rLeft) & "," & CStr(.rTop) & ")-(" & CStr(.rRight) & "," & CStr(.rBottom) & ")")
End With
With TitleInfo.rgstate
System.Diagnostics.Debug.WriteLine(.TitleBarState)
End With
'return with the TitleInfo
Return TitleInfo
End Function
'----------------------------------------------------------
My last test Return was:
Last DLL Error
(51,33)-(318,59)
STATE_SYSTEM_FOCUSABLE
whew.. Hope this helps...
|
|
|
|
|
Shweeet. Dunno how u got this working properly, well I havent reviewed it yet properly, but everything seems right.
Thanks alot Anonymous!
I actually resorted to GetWindowLong to check if the caption buttons r there.
Well done, ur a genius :>
|
|
|
|
|
Wasnt logged in there... Thanks so much for your work, Anonymous, and the last post was mine. Cheers mate
|
|
|
|
|
AndrewVos,
Thanks, it was interesting, and no problem, I don't log in a lot of times either.
progload
|
|
|
|
|
i have an application that I wrote about a year ago. Within this application I allow certain users to change the DB access for all users of the application on a given PC.
SaveSetting("DMaTS", "SQL_Server", "ServerName", gstrServer)
**where gstrServer is the name of the server)
This has worked without issue until recently when I have opened this code up and have added new functionality. Now the SaveSettings only works for the user that applied the DB Change. Is this change if bahavior something to do with some security patching?
If I do a registry check for the entry is lists under "Current User..."?
I am a bit puzzled by this change in behavior and am looking for an explanation of why, as well as any corrective action I should take to correct my code and coding habits.
Thanks in Advance.
mtognetti.
|
|
|
|
|
SaveSetting has always saved to HKEY_CURRENT_USER . I don't know what's changed, but this functionality wasn't it. Anything saved under CurrentUser is visible only to the user that saved it, not to anyone else.
If you need to save application settings that apply to all users of your application, then they should have gone under HKEY_LOCAL_MACHINE .
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
As I have done some further reading since posting this I have come to the same conclusion that you have.
Thank you for the validation. I will now redefine this to actually change/add the setting to HK_Local_Machine. This way I will actually get the functionality that I am expecting...all of the time.
Thanks again.
Mtognetti
|
|
|
|
|
Hi everyone,
I have found tons and tons of code on how to add users to the active directory, but I have not found much on how to set folder permission for these users. I have an FTP site that I use a batch to create 50 username and password combinations and then I add those to the active directory (currently by hand; working on code for autonomous). I then have to set all the user permissions to the folder that is reserved for each user. Everywhere I look there is very little discussion on how to do this automatically. Any help is VERY appreciated. Thanks!
Mike
Gaming at the GuildofBlades.com is the only way to really experiece the level 99 Soul-Sucking Sword!
|
|
|
|