Honestly the best way to learn how a runtime works is to learn how to debug it at the lowest levels. Read every single article here: Tess Ferrandez on MSDN[^]. Read if from start to end (well, actually end to start) and you should have really good in-depth knowledge (granted, reading and digesting that whole blog will probably take a few months). Real-world experience/stories sticks a lot better than raw theory (at least in my experience).
He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Chinese Proverb]
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.
can anyone help explain what might happen to a .NET application if file system crash? Simply put, should the apps pop up warning/error reminding that file system is carshed? How does your apps deal with file system crash?
for example, a designated folder got changed, not able to write into it, the system shall pop up error message, right? so I have to make specific error exception/message for this kind of case, otherwise the system just gave general error message, am I right?
As the inability to save to a certain location is a predictable exception (e.g. the user attempts to save into the Windows folder on Windows 7 when running with normal permissions), it's always a good idea to protect against this type of exception.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
can anyone help explain what might happen to a .NET application if file system
In general - no.
How does your apps deal with file system crash?
Whatever the business requirements suggest and reasonable extrapolation from that.
For example I don't try to do anything at all about the file system filling up for a server. Can it happen? Yes. If it does what can I do? Nothing. I do however expect that any reasonable operations setup would take into account file system monitoring.
As another example if I can't read a configuration file that the server requires on start up then besides logging an error I can do one of the following
- Start with default values.
- Exit the server.
The choice depends on what was supposed to be in the configuration file that I was reading.
(Note that a logging solution MUST be implemented such that a logging failure does not stop the application from running.)
A stand alone user application should probably do something different. If it cannot read/write to the fle system then it should report that to the user.
Just a guess: The backslash/left-angle-bracket combination may be confusing the parser. The backslash character is sometimes used to "escape" the following character. If this is happening, it may not be recognizing the left-angle bracket or the end tag.
Dim myprocess As New Process
Dim StartInfo As New System.Diagnostics.ProcessStartInfo
Public Sub Audio128(ByVal MyPathandFilename As String, ByVal MyFileName As String)
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 file using 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 image As Image
Private FirstTime AsBoolean = True'flag to indicate the pressed state
Private bPushed AsBooleanPrivate m_bmpOffscreen As Bitmap
bPushed = False'default minimal size
Me.Size = New Size(21, 21)
EndSubProtectedOverridesSub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Dim gxOff As Graphics 'Offscreen graphics
Dim imgRect As Rectangle 'image rectangle
Dim backBrush As Brush 'brush for filling a backcolor
'If (m_bmpOffscreen.Equals(Nothing)) Then 'Bitmap for doublebuffering
If (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 control
Dim 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 key
Dim 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
Dim 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.