|
Hi,
I'm using sockets to handle network communications for my application but a running into the problem that I can't select which NIC to use on machines that have multiple. Is there anyway to set this for a socket? Does anyone know how to retrieve all available interfaces and select the appropriate one?
Thanks in advance,
Benny
|
|
|
|
|
I have a requirement that i can upload any file to the database (i am using SQL SERVER, ASP.NET and C#). I am able to achieve it but the other requirement is to fetch the file and open it with an "Open With" dialog box (so that it can be opened with any application) .
Eg if i uploaded "File1.txt" to the DB then if i need to open this file with the desired application using an "Open With" dialog box (ie., i can open .txt file in MsWord).
Any ideas?????
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
You can't. The bindings for which applications control which files is controlled on the users PC. The only time that this dialog appears is if the file type is one that hasn't been registered on the user's machine.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
isn't there any way? or should i write my custom dialog for it?
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
u need to know how the particular exe is accepting the filename as its parameter.
and you cannot stream a file from DB.
so your steps will be,
1) Get the file from DB and copy it in a local folder.
2) Ask the user to select a particular exe from file dialog,
3) Use processstartinfo, give exe name as selected exe, and the file to be opened as a parameter.
MSWord, notepad supports commandl line execution
eq:
winword c:\mydoc.txt
notepad c:\mydoc.txt
thanks and regards,
Karam C Bose
|
|
|
|
|
If I'm reading the requirement right, he wants to open the item back over the internet so you cannot use ProcessStart. This works locally only.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
may be he can write a .net component, wrap it as a com, which will be downloaded and installed automatically from a cab file from webserver, whose methods can be called from java script, enabling the use of process.start
Karam c Bose
|
|
|
|
|
|
hi
can any one plz tell mehow can we validate an email address in a windows application .net2.0
thanks
Rocky
|
|
|
|
|
What. Validate that the format of the email address is OK, or that the email is connected to a live account? The two are considerably different.
If you want to validate the email address, you can use a simple regex to do this (like the following one):
\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
you can use this
<br />
public static bool IsValidEmailAddress(string sEmail)<br />
{<br />
<br />
if (sEmail == null)<br />
{<br />
return false;<br />
}<br />
else<br />
{<br />
return Regex.IsMatch(sEmail, @"^[-a-zA-Z0-9][-.a-zA-Z0-9]*@[-.a-zA-Z0-9]+<br />
(\.[-.a-zA-Z0-9]+)*<br />
\.<br />
(<br />
com|edu|info|gov|int|mil|net|org|biz|<br />
name|museum|coop|aero|pro<br />
|<br />
[a-zA-Z]{2}<br />
)<br />
$",<br />
RegexOptions.IgnorePatternWhitespace);<br />
}<br />
}<br />
<br />
hope it helps
|
|
|
|
|
yea it looks pretty helpful to me. Im gona try it today
thanks alot I appreciate it
|
|
|
|
|
It all depends on how strictly you want to follow the RFC specification. The regular expressions will catch the more commonly used forms, but not all of them.
You can also use the MailAddress[^] class, which is new in .NET 2.0. This class will work for almost all of the RFC formats, but again there are some that it doesn't get right.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
well I'm certainly gonna look into this one... looks interesting to me. hope it works with windows forms too.
|
|
|
|
|
Rocky71 wrote: hope it works with windows forms too.
Yes, it most definately works with WinForms applications.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
yea it did and thanks alot u know I appreciate it.
I also tried the other solution given by teh other friend here n that worked as well
So thanks alot both of u guys
Rocky
|
|
|
|
|
How to create XmlAttributeCollection.
|
|
|
|
|
I think, you cannot create XmlAttributeCollection, but you can add XmlAttribute to XmlElement.
See example:
System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument();
System.Xml.XmlElement xmlElement = xmlDocument.CreateElement("MyElement");
System.Xml.XmlAttribute xmlAttribute = xmlDocument.CreateAttribute("MyAttribute");
xmlAttribute.Value = "Hello World";
xmlElement.Attributes.Append(xmlAttribute);
xmlDocument.AppendChild(xmlElement);
xmlDocument.Save("test.xml");
|
|
|
|
|
How I can create New Folder using c#.net 1.1 in (c:\ or d:\ )
this is haneef
|
|
|
|
|
if (!Directory.Exists(directoryName))
{
Directory.CreateDirectory(directoryName);
}
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
public void Backup()
{
SQLServer2Class server = new SQLServer2Class();
Databases databases;
Database2 database;
Backup2Class backup = new Backup2Class();
server.LoginSecure = true;
server.Connect("192.168.1.145" , "ad" , "ad123");
//the above ip address is my remote computer ip address and ad is username,
ad123 is password of remotecomputer.
//i gave userid and password then also it is not working showing exception access is denied
databases = server.Databases;
string database1="pubs";
database = (Database2) databases.Item(database1, null);
backup.PercentCompleteNotification = 1;
backup.Database = database.Name;
SaveFileDialog saveFileDialog1=new SaveFileDialog();
saveFileDialog1.ShowDialog();
this is haneef
|
|
|
|
|
have u added the remote sql server in ur list of sql servers availabel over the network. I dont know if I'm using the rt word for it but anyway. it's shown in the enterprise manager right atthe same level where u see the node for ur local server. I may be wrong but I think u'll get this eror as long as u dont register that.
hope it helps
Rocky
|
|
|
|
|
Hi there,
I hope that every .net programmer knows about app.ico. If not then create a windows application in c# and check out the working folder. You could see such a file there. This file is the picture file that is displayed in the exe file(check out debug folder of your application). Now what i need is, i want to change this app.ico through c# coding. Is it possible for changing the application icon at runtime without re-compiling? When i mention a .ico file, at runtime, this new .ico file should replace the existing default app.ico file and my .exe file in debug folder should also posses this image. How can this be made?
|
|
|
|
|
Be patient! This isn't a service hotline, you pay for. So 1. don't expect to become an answer at all and 2. don't expect to become an answer instantly. We're all answering questions in our spare time and words like urgent or postings as above doesn't help to speed up things but rather decrease the willingness to answer at all.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|