Tuesday, November 27, 2007

Pokemon Dawn Short Hair

Crystal Reports Connection Strings Email Sending codes

Hello

reading around I found this site

http://www.connectionstrings.com/

visit it have connection strings for all types of data sources

& # 160;


salu2 Sergio

Friday, November 23, 2007

Nose Bleed Every Morning



Hello

Something that is very interesting and useful is to add to your applications the ability to send emails, so I pass the code that uses a Gmail account to make mailings, the advantage of using gmail is always available because it is free lol, the only care to be taken is to indicate the port right and send SMTP SSL, well there goes the code.

1. Include the following in the source file

Imports System.Net.Mail

2. The code for sending via gmail goes like

'First we set the Parameters to send to gmail

Dim As oSmtp SmtpClient = New SmtpClient
New oSmtp.Credentials = System.Net. NetworkCredential ( "MiCuenta@gmail.com" , "ElSuperPassw" )
oSmtp.Port = 587 'Gmail needs a specific port
oSmtp.Host = "smtp.gmail.com"
oSmtp.EnableSsl = True 'Gmail need to send by SSL

Dim As oMail MailMessage = New MailMessage
oMail.To.Add ( destino1@gmail.com )
oMail.To.Add ( destino2@gmail.com )
oMail.From = New MailAddress ( "MiCuenta@gmail.com" , ", System.Text.Encoding.UTF8)
oMail.Subject = "This mail is ...."

oMail.SubjectEncoding = System.Text.Encoding.UTF8

'----

creation of the post Dim

s As New System.Text.StringBuilder

s.Append( "bla bla bla bla" & vbCrLf)
s.Append( "bla bla bla bla" & vbCrLf)
s.Append( "bla bla bla bla" & vbCrLf)

oMail.Body = s.ToString

oMail.BodyEncoding = System.Text.Encoding.UTF8
oMail.IsBodyHtml = False

Try
oSmtp.Send(oMail)

Catch ex As System.Net.Mail.SmtpException
msgbox "Error " & ex.Message

End Try

Well that's it, I hope they serve,

Salu2
Sergio

Sunday, November 11, 2007

Can You Sleep With Compression Shorts On

The path of the application

Hello I've been looking for ways in which to find the folder for the Implementation ; ny finally found several ways to do

Form 1: Using
Reflection, we find the path of the assembly that is running, but that if you take into account that this works Windows applications, web application returns the path to a temporary, which is not the path where the dll is being

running

Spath = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly.Location)

through the class path only extract the asembly directory run the command running

Form 2:
Spath = System . AppDomain.CurrentDomain.RelativeSearchPath

This method works well in web applications that call for the assembly in which you run the command above, but in windows applications not working, why? .. not yet (maybe after you find out) returns null

Forma3:
Spath = System.AppDomain.CurrentDomain.BaseDirectory
This form has an interesting behavior when an application runs on Windows returns the directory where the DLL is running the method, but when tested in an application n Web or a WebService which returns the Web application root

An application for this could be that bald or want to verify the license of your system and it be read a file that has the license key and is hosted in the folder of the DLL that runs the verification method. For that creeen a method in that DLL something like this:

Public

Shared Function Licenciaválida() As Boolean

Dim sPath As String

sPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location)

sPath & = "\MiFile.txt"


If
Not File.Exists(sPath) Then
   
sPath = System.AppDomain.CurrentDomain.RelativeSearchPath
    sPath & = "\MiFile.txt"

    If Not File.Exists(sPath) Then
       
sPath = System.AppDomain.CurrentDomain.BaseDirectory
        sPath & = "\MiFile.txt"

     End If

End If

f =

New StreamReader(sPath)
Dim s_CLave As String = f.ReadLine
f.Close()
f =
Nothing

return VerificarClave( s_Clave)


End Function

That's all for today

Salu2
Sergio

Thursday, November 8, 2007

Pattern For Papoose Carrier

How to open files from the application

Hello

windows

Something interesting is the fact 2 clicks with the mouse on a file and this will open the corresponding program, the certainty it from our windows applications is quite easy, really boils down to a single line of code is:

Shell ( "rundll32.exe url.dll, FileProtocolHandler" & ( "c: \\ windows \\ system32 \\ calc.exe" ))

Shell ( "rundll32.exe url.dll, FileProtocolHandler" & ( "c: \\ Milibro. xls " ))

In the 2 examples above there were 2 cases the first to open the windows calculator and the second opens the excel and load it to the book by name MiLibro.xls

This code only have it be placed in a delegate and ready, such as the click event handler of a button as forexample.

Private Sub Button1_Click (ByVal sender As System.Object, ByVal and As System.EventArgs) Handles

Button1.Click Shell (

"rundll32.exe url.dll, FileProtocolHandler " & ( " c: \\ windows \\ system32 \\ calc.exe " ))

End Sub

Salu2
Sergio

Wednesday, November 7, 2007

Dogs Legs Twitching When Awake

10 points to know about VS2008 and Framework 3.5

Daniel Moth, a developer of Microsoft, published a post called 10 points to know about Visual Studio 2008 and. NET framework 3.5 here translate it and add a couple of concepts referred to in the website of Daniel Moth.

1.
Launches VS2008 and. NET framework 3.5 will be officially launched together next February. However, developers will be available in late November 2007. The same types of publishers and versions Expreess ie, Standard and Professional only in the Professional version will include a test module will be available in VS2008 but a new version called VS2008 Shell which will bring new advantages because it is designed exclusively for Vista, now XP seems that began her journey to
withdrawal 2. Backward compatibility
. NET framework 3.5 continues the line started by the framework 3.0 in regard to maintaining the versions that is not changed from the framework libraries 2.0 and all it does is add new assemblies own Framework 3.5 libraries to 2.0 and 3.0 of the framework, current applications will not be affected. Of course, you will need the Service Packs 1 on both platforms.

3. Generation platform (multi rather framework)
Visual Studio 2008 includes the ability to create projects for multiple platforms. NET, ie, 2.0, 3.0 and 3.5, from the same environment. Therefore not necessary to have installed VS2005 to generate assemblies. NET 2.0. With this we can say goodbye to VS2005, we just do not do the same with the VS2003 or 2002 (if still available)

4. Many new features in C # 3.0 and VB9 Properties
automatic delegates "relaxed" , object initializers, type inference, anonymous types, extension methods, lambda functions and partial methods, among others.
most interesting thing is that we can use the new features in the generation of applications for version 2.0

5. LINQ
The new earthquake data handling one of the great revolutions that MS brings to the VS2008. Language Integrated Query is a new way to access the data fully integrated into the language. Net either vb, c # ... etc. The interesting thing is that it is independent of the source they come from the data, the key point is that I think best describes the importance of LINQ (LINQ video A) is that now we can mix different data sources in a query, such diverse origins as collections, XML, BD. According to Daniel is the most important of the new version.

6. Integrated with ASP.NET AJAX!

Visual Studio, and the new framework, and include ASP.NET AJAX and 3 new controls that are ListView, DataPager and LinqDataSource. In addition, the IDE has been improved and includes support for intellisense and debugging Javascripts! (This is a big plus), also now incorporated masterpages nesting.

7. For Windows
VS2008 projects include new project templates, as well as a designer for WPF integrated support for communication between WPF and Windows Forms . Also added support for Firefox ClickOnce technology and XBAP (XAML Browser Applications).

8. For those who develop on office
It offers full support for customizations (customisations) Office 2007 and Office Templates for 2003.

9. Server Developer
have added new templates for WCF and WF for a better work together, now WCF programming model supports SOAP-less HTTP, JSON serialization, a collection of links on these issues here

10. For the mobile developer
There are tons of new features, including support for the compact versions of LINQ and WPF, or, in terms of IDE, Unit Testing for Devices, and many new ideas development team.

11. Framework code

Now we can debug via VS2008 framework methods! This is why MS came up with open source code of the framework, here a link to the topic

Salu2
Sergio