|
You may need to do the mappings manually, unless your CSV file's first line contains the column names and they match the ones in the database.
And you're in the wrong forum, by the way.
|
|
|
|
|
I have a Java webservice, and i consuming the this java webservice through .Net client. and i am using Microsoft WSE 2.0 for web security. I have created a proxy of this java webservice. This proxy class has 23 webmethods. I am passing the user credentials through UsernameToken object before invoking a webmethod as follows...
userToken = new UsernameToken("Ram", "Ram_Mohan", PasswordOption.SendPlainText);
WebServiceBean theProxy = new WebServiceBean()
theProxy .Security.Timestamp.TtlInSeconds = 60;
theProxy.Security.Tokens.Add(userToken);
Now i will invoke webmethod as fallows...
string rtnValue = theProxy.createWorkEx(userId, createWorkXml);
The above procedure is to invoke the webmethod
theProxy.createWorkEx(userId, createWorkXml);
And it is working fine as expected.
But my requirement is something like this, As i said earlier the proxy has 23 webmehtods. Now i don't want to repeat the same procedure invoke all the 23 webmehtods as i did for theProxy.createWorkEx(userId, createWorkXml).
Is there any generic way or a pattern, where i can implement same procedure for all the 23 webmethod at a single point? I dont want to repeat the same code 23 times for invoking 23 methods.
Any thoughts or links on this?
Thanks.
Venkat
|
|
|
|
|
Write a wrapper class that encapsulates the complexity of the web service.
|
|
|
|
|
I am needing to get AD information from a user logon name like AEM\jdixon
Im using this for a website to authenticate people to get their Division, First and Last name automatically without them having to sign in or anything.
This is what I have:
using (DirectoryEntry root = new DirectoryEntry())
{
root.Username = username;
root.Password = password;
root.Path = LDAPPath;
using (DirectorySearcher searcher = new DirectorySearcher())
{
searcher.SearchRoot = root;
searcher.SearchScope = SearchScope.Subtree;
searcher.Filter = "(objectClass=user)";
searcher.PropertiesToLoad.Add("msDS-PrincipalName");
seacher.PropertiesToLoad.Add("divison");
SearchResultCollection results = searcher.FindAll();
StringBuilder summary = new StringBuilder();
foreach (SearchResult result in results)
{
foreach (string propName in result.Properties.PropertyNames)
{
foreach (string s in result.Properties[propName])
{
summary.Append(" " + propName + ": " + s + "\r\n");
}
}
summary.Append("\r\n");
}
textBoxResults.Text = summary.ToString();
}
}
Now I got this from someone else on here that I seen in an article. But I also have my book here and I'm not seeing what I want to do. See in ASP.net you can get their Windows Logon name simple right? Which would pull (lets use mine for example) AEM\JDIXON
So now that I have AEM\JDIXON, I want to search AD (first to make sure it exist) and if it exist I want it to pull what DIVISON and the First and Last name. This is for a ticket application.
|
|
|
|
|
Hi to all.
I would to know if there is any in c# to do an ftp transfer server to server.
I need to transfer a file located in ftp directory to another ftp directory.
Example ? idea ? everything is accepted!
Tnx for answers
|
|
|
|
|
If you want to copy the file on the same server but different directory then just COPY the files.
If its different server then on the source server, you have to implement ftp client. which connects to the destination server and transfer the file. using this inbuilt class in c#[^]. if you want to implement the same thing in reverse then you have to code the same thing on both the server.
also you can do this buy just implementing this on one server, and then you can use PUT and GET to transfer the file both the ways, but it depends upon the requirements.
|
|
|
|
|
ok....tnx for answers, but my situation is:
Example:
source: ftp://myaddreessFtp/mydirectory/file1.xxx
destination: ftp://anotherFtpAddress/Anotherdirectory/
I want to trasfer file1.xxx from source to destination
the classes that you mentioned can not do that.
bye
|
|
|
|
|
OK so you have already setup the FTP service on both the server. just implement a application using this[^] code, which Downloads the file from SOURCE and then Uploads it to the DESTINATION. No need to implement anything on any of the server.
in that code you just have to specify the source server with username/password and Download the file, and after that again specify the destination server with username/password and Upload the file.
also you can do this by using the inbuilt classes, which i told you earlier, but they are more basic and you have to implement lot of coding to make it work.
|
|
|
|
|
ok you have right but....i can't download the file before upload in other server,
I need to upload the file directly to other server, the files that I use often are more more big, Ex: 600, 700 GB.
I need to implementing a directly upload like Flash ftp, you know ?
|
|
|
|
|
anyone who has tool of " c++ convert to c#" for free?
|
|
|
|
|
I don't think it's *that* simple as there are different variations of C++, and sometimes C++ reaches parts that C# just can't reach.
This post[^] may be a posssible way?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
There is an online converter:
<a href="http://code2code.net/">http://code2code.net/</a>[<a href="http://code2code.net/" target="_blank" title="New Window">^</a>]
We have a 'demo' edition of our C++ to C# converter, which will convert up to 100 lines at a time 'for free'.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
Hi,
I am currently writing a program to automaticly encrypt PHP code.
Hovewer, I need to find every occurences of php code (<?|<?php //content ?>) and loop through the contents of this.
So...
If I for example enter the string:
Testing
<?
echo "test";
?>
<?
$variable = "another test";
echo $variable;
?>
The script should find the two occurences of PHP code, and return them in two messageboxes.
The first one should return MessageBox.Show("echo \"test\";"); etc.
So, find the PHP tags, loop through them (a for loop, I assume), and then put the contents into a string variable (so I can just say MessageBox.Show(phpText);).
Does anyone have a clue on how to do this?
Thanks.
|
|
|
|
|
Im not very sure about real code for you now, but i suggest you should take a look into Regualar Expressions. Regular expressions let you identify portions of strings, characters or even patterns of strings in given source strings (e.g. tag-like structures). You can even replace strings of an expressed pattern in a given source string.
.Net supports Regular Expressions since the earliest versions. I guess it will suffice. Ask Mr. Google about examples of regular expressions...
Sory bro, that I cannot give you any real code. However, i hope my answer leads you to a solutions.
Best regards
Trollpower
|
|
|
|
|
Yeah.. I know regex's (I've been writing PHP's for years now ).
Just don't know how to do it in C#, I would do it like this in PHP:
preg_match_all("#<? (.*?) ?>#si",$content,$matched);
modified on Friday, December 19, 2008 8:44 AM
|
|
|
|
|
The MSDN website has a good explanation of the regular expression capabilities in .NET. [^]
99% of what you know will transfer from PHP. The most obvious differences are that you do not start and end the pattern with a delimiter character and that you specify expression options (like the si at the end of your expression) differently. There are also some advanced things you can do with .NET regular expressions, but you probably will not need them here.
As for looping through the matches, you will probably use a while loop
using System.Text.RegularExpressions;
string phpFileText = ;
Regex matcher = new Regex(,
);
Match code = matcher.Match(phpFileText);
while (code.Success)
{
code = code.NextMatch();
}
PS: don't forget that ? is a quantifier in regular expressions, so you need to escape them when searching for a literal ?
|
|
|
|
|
I want to find column index of particular column in DataGrid by just passing column value.Is it possible.
If anyone knows please reply,
Thanks.
|
|
|
|
|
Yes, but what happens if more than 1 column or row contains the value? You can find the column index by iterating throught he ciolumns and rows.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
hello all
I have an application in c#. which i want make in as a plugin .... to eclipse
is this posiible ?
if so how ?
kindly plz provide me with some suggestions
Thanks
TJS
|
|
|
|
|
I expect the best place to start would be the eclipse web site or their tech support to see how you define a plugin to their app.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I've object and it has a lot of objects
When I access Childobjects everything is ok but not MemoryStreams;
public class myObject
{
public List<ChildObject> subObject = new List<ChildObject> { };
public string ObjectName { get; set; }
public class ChildObject
{
public string ChildObjectName { get; set; }
public MemoryStream ChildStream { get; set; }
}
}
When I use this object I am using following code;
MemoryStream myMS = new MemoryStream();
myMS.Position = 0;
myObject MyObj = new myObject();
MyObj.ObjectName = "My First Object";
MyObj.subObject.Add(new myObject.ChildObject());
MyObj.subObject[0].ChildObjectName = "My First Sub Object";
MyObj.subObject[0].ChildStream.Position = 0;
Thanks for your reply.
|
|
|
|
|
Indeed - you've not provided the error message you're getting.
Hold on though - I'll use my psychic powers.....
"Object reference not set to an instance of an object"
ChildStream has not been instantiated.
MyObj.subObject[0].ChildObjectName = "My First Sub Object";
MyObj.subObject[0].ChildStream = new MemoryStream()
MyObj.subObject[0].ChildStream.Position = 0;
|
|
|
|
|
Impressive
Is it possible to auto create this MemoryStream in my subClass's constructor?
When I Create following...
MyObj.subObject.Add(new myObject.ChildObject());
I want to use this MemoryStream directly.
Thanks
|
|
|
|
|
Sure, just add a constructor to ChildObject and instantiate the memoryStream therein.
|
|
|
|
|
Thanks for your help. This is work for me.
Final solution as like these;
public class myObject
{
public List<ChildObject> subObject = new List<ChildObject> { };
public string ObjectName { get; set; }
public class ChildObject
{
public string ChildObjectName { get; set; }
public MemoryStream ChildStream { get; set; }
public ChildObject()
{
ChildStream = new MemoryStream();
}
~ChildObject()
{
ChildStream.Dispose();
}
}
}
|
|
|
|