Dim myprocess AsNew Process
Dim StartInfo AsNew System.Diagnostics.ProcessStartInfo
PublicSub Audio128(ByVal MyPathandFilename AsString, ByVal MyFileName AsString)
StartInfo.FileName = MyProgram.exe
StartInfo.RedirectStandardInput = True
StartInfo.RedirectStandardOutput = True
StartInfo.UseShellExecute = False'required to redirect
myprocess.StartInfo = StartInfo
The script works fine but the prompt is displayed while the program EXE works.
Is possible to hide it?
Thanks in advance
In my asp.net dynamic data project I want toread an excel fileusing suitable Microsoft technology (Not Excel). Someone said their was a server side tool for this? I want toread the first few columns of data from a table?
Any suggestions or directions onwhereto go?
It depends on the version of Excel format the file is saved in. If it's in 2003 and below, it's a multiple stream binary file that will be just about impossible to decipher. If it's 2007 and above, it'll be a .ZIP format file with multiple XML files inside of it. Again, a royal pain to decipher without the SDK. Seriously, save yourself MONTHS of work and use the Visual Studio Tools for Office to do this.
I neglected to include my DB creation script in my Git repo to bring it home for some weekend get-ahead work. Now I thought the lauded 'Generate Database from Model' feature would be my saviour here, but it's useless. It uses the entity set names to generate table names, so where all my original table names were singular, the generated ones are plural.
Some wag at StackOverflow suggested making all the entity set names singular but all I can think of is somehow extracting all original table names, generating the script, then doing a marathon search and replace. Any suggestions on how I could do this? Any other suggestions?
Disclaimer: This is a duplicate of my StackOverflow question here.
Hey..I'm new to VB.net programming and i'm having a problem with my project.
here's a sample code
Private Sub MinsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinsToolStripMenuItem.Click
Dim b As Boolean
MsgBox(" pop up will return on " & Now.AddMinutes(5))
Dim a = Now.AddMinutes(5)
b = System.Convert.ToBoolean(a)
Catch exception As System.InvalidCastException
If a = True Then
What i want is that after I click the MinsToolStripMenuItem, it will wait for five mins and after that, popupnotifier will popup..
I am using Entity Framework 1.0, I have Claims Table as master table and Requests Table as details table. First I am deleting data from Requests (details) table and then I am trying to delete data from master table.
Even though there is no record exists in Requests table I am unable to delete rows from Claims table, it is throwing FK relationship exception. What could be the reason? I am not understaing because when there is no recod exists in Details table for the Master table record. Then that record in Master table should be easily deleted.
I am trying my best to resolve is, any body if they have any idea please help me.
I am trying to google too, but if anybody have any idea, it would be great if they help me.
Some general possibilities
- There is still something in details.
- The way you coded the details delete in the framework is wrong.
- The framework is handling the delete for you as a batch but when it does the real commit it is doing the master delete first.
I need to pu an image in a button but my application runs in Windows CE so I'm using the Compact Framework and in this context the object Button has no property like Image, BackgroundImage, Bitmap or something similar.
Anybody knows how I can do?
Well... I can't say that I have understood everything in the MSDN example but I managed to convert it to Visual Studio .NET 2008 and to make it work!!!!
Yes, it would be easier something like Button.BkImage("image.bmp") but ... it seems that the Compact Framework is missing many things that I need!!!
Once again, Thank you Eddy!!
I publish the code of MyImageButton class if it can help someone or anyone has any corrections to suggest.
'Private membersPrivate image As Image
Private FirstTime AsBoolean = True'flag to indicate the pressed statePrivate bPushed AsBooleanPrivate m_bmpOffscreen As Bitmap
bPushed = False'default minimal sizeMe.Size = New Size(21, 21)
EndSubProtectedOverridesSub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Dim gxOff As Graphics 'Offscreen graphicsDim imgRect As Rectangle 'image rectangleDim backBrush As Brush 'brush for filling a backcolor'If (m_bmpOffscreen.Equals(Nothing)) Then 'Bitmap for doublebufferingIf (FirstTime) Then
m_bmpOffscreen = New Bitmap(ClientSize.Width, ClientSize.Height)
gxOff = Graphics.FromImage(m_bmpOffscreen)
If (Not bPushed) Then
backBrush = New SolidBrush(Parent.BackColor)
Else'change the background when it's pressed
backBrush = New SolidBrush(Color.LightGray)
If (Not image.Equals(DBNull.Value)) Then'Center the image relativelly to the controlDim imageLeft AsInt32 = (Me.Width - image.Width) / 2Dim imageTop AsInt32 = (Me.Height - image.Height) / 2If (Not bPushed) Then
imgRect = New Rectangle(imageLeft, imageTop, image.Width, image.Height)
Else'The button was pressed'Shift the image by one pixel
imgRect = New Rectangle(imageLeft + 1, imageTop + 1, image.Width, image.Height)
EndIf'Set transparent keyDim imageAttr As ImageAttributes = New ImageAttributes()
gxOff.DrawImage(image, imgRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, imageAttr)
EndIfIf (bPushed) Then'The button was pressed'Prepare rectangleDim rc As Rectangle = Me.ClientRectangle
rc.Width -= 1
rc.Height -= 1'Draw rectangle
gxOff.DrawRectangle(New Pen(Color.Black), rc)
EndIf'/Draw from the memory bitmap
e.Graphics.DrawImage(m_bmpOffscreen, 0, 0)
EndSubPrivateFunction BackgroundImageColor(ByVal image As Image) As Color
Dim bmp As Bitmap = New Bitmap(image)
Return bmp.GetPixel(0, 0)
EndFunctionProtectedOverridesSub OnPaintBackground(ByVal e As System.Windows.Forms.PaintEventArgs)
EndSubProtectedOverridesSub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
bPushed = TrueMe.Invalidate()
EndSubProtectedOverridesSub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
bPushed = FalseMe.Invalidate()
EndSubPublicProperty MImage() As Image
EndGetSet(ByVal value As Image)
image = value
Thank you halabella for your answer.
It can be a possibility but in this way I think you lose the behavior of the button (button pressed - button not pressed).
In my particular case I could just use an image because the text I need to write is a symbol of a font type not included in my Windows CE (for this reason I need to put an image in a button) but there would be much difference aesthetically with the other buttons of the form.
...but perhaps I could change the image on the click event... yes, it is a possibility.
Don't know if it helps, but there's a <a href="http://msdn.microsoft.com/en-us/library/de8fssa4.aspx">BitConverter</a>[<a href="http://msdn.microsoft.com/en-us/library/de8fssa4.aspx" target="_blank" title="New Window">^</a>] available. There's an example of it's usage on the same page.
My C# solution contains several EXE's and one DLL. All of the EXE's hold references to the DLL because they all depend upon the types implemented by the DLL.
Now, even if I make a trivial change to the DLL that does not alter the public interfaces and methods of its types, Visual Studio rebuilds not only the DLL, but also all of the EXE's that depend upon it.
So my question is: Must I redistribute the rebuilt EXE's as well as the rebuilt DLL, even if my changes to the DLL do not alter any public interfaces or methods?
It seems to defeat the purpose of putting widely used types into a common DLL, if I must rebuild and redeploy any EXE's that use the DLL after making strictly internal changes to the DLL.
Thank you for reading my question.
The difficult we do right away...
...the impossible takes slightly longer.
I got a requirement of applying method level security for the logged in user.
What they just instructed is:
for every method in the code there will be corresponding binary code ..
and for each permission for this method there will be binary code too..
Now when user log in window application it will be checked if this user has permission to execute this method.
I dont have any idea about this..
can anybody provide good links for it or if someone has ever implemented this sort of thing.. Help me out..
You could use the RoleProvider to determine whether or not the user has the appropriate permission to execute a particular method.
I will say, however, that you should be approaching this from the perspective of what the user sees rather than locking off individual methods. In other words, it's better to prevent the user from being able to see a menu option/click it, than it is to let them click it and then tell them that they didn't have the appropriate permission to execute the method.
As you haven't stated what technology you are using, this is as close as I'm going to be able to give you a full answer without overloading you with details for technologies you aren't interested in.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
I used to encrypt and store my applications (Web Forms – Windows Forms) user password in the database.
I usually during the creation of a new user, I get the user password as a plain text and I create a new hash value then I encrypt the concatenation of the password plain text and the hash value. I store both the encrypted password and the hash value in the database.
During the user login authentication process I get the supplied user password as plain text then I retrieve the stored hash and the encrypted password for that user from the database. I repeat the same encryption again which I used during the new user creation operation but with concatenation of the retrieved hash from the database and the supplied plain text password then I compare both the database retrieved encrypted password with new encrypted password. If they are matching the login validation passes otherwise it fails.
I used to use "FormsAuthentication.HashPasswordForStoringInConfigFile" in the namespace "System.Web.Security" to encrypt the passwords for both of my windows Forms and web forms applications. But now with the .Net framework 4.5 the following method:
"HashPasswordForStoringInConfigFile(Password as string, PasswordFormat as string) as string" is obsolete.
Please anyone have any idea what is the new alternative for this method?
does VS put some files in Bin, and other files elsewhere?
Yes. Take a look at the directory structure under your solution directory and you will see the other directories. You can also look through your project properties to see which part of the build uses which directories.
One of these days I'm going to think of a really clever signature.
You could change the output path by simply setting the output path attribute in the project's Build properties.
They could be put elsewhere so long as all the dependent dll's are also available in the same folder.
I am getting following error when I am trying to assign a null value or nuthing value to a variable of type Nullable(Of Decimal).
But for that variable I want to assign a decimal value or null value. The same kind of problem I faced with Nullable (of DateTime) too. It cant take a nothing assigned to it. If it cant take that value then why is it nullable(of Decimal) or Nullable (of DateTime) and System.Nullable(Of Integer) is also not taking null values (means nothing value in VB.Net).
Please help me in resolving this issue.
thanks in advance.
Below is my code: I tried by just putting variable=nothing also but didnt work.
If savRequestData.PropRequestWage IsNot Nothing Then
wagesegment = New List(Of ReqWage)
For Each temp In savRequestData.PropRequestWage
Dim wage As New ReqWage
wage.DailyWage = IIf(Not String.IsNullOrEmpty(temp.DailyWage), IIf(Decimal.TryParse(temp.DailyWage, tempDecimal), tempDecimal, CType(Nothing, System.Nullable(Of Decimal))), CType(Nothing, System.Nullable(Of Decimal)))
wage.RequestId = request_Id
wage.WorkDate = temp.WorkDate
wage.WorkHours = IIf(Not String.IsNullOrEmpty(temp.WorkHours), IIf(Decimal.TryParse(temp.WorkHours, tempDecimal), tempDecimal, CType(Nothing, System.Nullable(Of Decimal))), CType(Nothing, System.Nullable(Of Decimal)))
requestedamount += IIf(temp.DailyWage IsNot Nothing, temp.DailyWage, 0)