Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
S

Snowjim

@Snowjim
About
Posts
221
Topics
102
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to post on facebook page?
    S Snowjim

    Hi, I have created a facebook page and a facebook application for my ASP.NET website and now I need to post messages from my ASP.NET webpage onto the facebook page with help of facebook SDK .NET. This is what I got so far :

    public static bool UploadPost(string message)
    {
    dynamic result;

        //https://developers.facebook.com/tools/explorer/
        //https://developers.facebook.com/tools/access\_token/
        FacebookClient client = new FacebookClient("secret access token");
    
    
        result = client.Get("oauth/access\_token", new
            {
                client\_id = "\[Client ID number\]",
                client\_secret = "\[Client sercret",
                grant\_type = "client\_credentials",
            });
    
        result = client.Post("\[facebook app Id\]/feed", new { message = "Test Message from app" });
        //result.id;
        result = client.Get("\[facebook app Id\]");
    
        return false;
    }
    

    When running this I get(on client.Post) :

    Additional information: (OAuthException - #200) (#200) The user hasn't authorized the application to perform this action

    If I remove the client.Post row every thing works good, the correct data is fetched. I have tried follow some helps on facebook SDK .NET website but it is still not working. Pleas help

    Web Development csharp asp-net com tools help

  • Why am I not getting any values on basic performance counters?
    S Snowjim

    Hi, I have a WCF(TCP/WAS) service communicating with a winform application. I have tried to get the following performance counters from this service : ServiceModelService 4.0.0.0 ServiceModelOperation 4.0.0.0 ServiceModelEndPoint 4.0.0.0 I do hoverver never get any values on these counters. This solution : TestProject shows how my solution is setup but this test project do work with performance counters. The question is what would make the performance counters to not record any values? I have invested alot of hours to locate diffrences in this testproject and the real one but havent found anything yet?

    .NET (Core and Framework) question csharp wcf com performance

  • Resource in separate project?
    S Snowjim

    Hey! I have created a simple class library project where I have added some resx(resource) files and some images in folders. I need this images to be available to other projects like my winclient, how do I accomplish this? It would be grate it I could use the resx files directly in my winclient project or at least get intelisens on the images. Any Idé?

    C# question learning

  • Simple webservice consumed by php problem, maby namespace problem?
    S Snowjim

    Hey! I have a wary simple webservice: [WebService(Namespace = "http://test.net/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class companyService : System.Web.Services.WebService { private companyDatabaseHandler dbHandler = new companyDatabaseHandler(); public companyService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World"; } [WebMethod] public int getIdByGameName(string gameName) { try { if (gameName != null && gameName.Length > 0) return dbHandler.getBoardGameGeekGameIdByGaneName(gameName); throw (new Exception("gameName is not correct.")); } catch (Exception ex) { throw ex; } } } I can contakt this webservice with PHP using nuSoup. But when It arrives to getIdByGameName the gameName is null? Here is the simple PHP software that are about to cosume the webservice: index.php '; echo 'Spelnamn: '; echo ''; echo ''; } else { require_once('nusoap.php'); $wsdl = "companyService.wsdl"; $client = new soapclient($wsdl, 'wsdl'); $param = array( 'gameName' => $_POST['namn'] ); $result = $client->call('getIdByGameName', $param); if ($err = $client->getError()) { echo "The server returned error: $err"; } else { echo "ID för spel med namn {$_POST['namn']} är: $result \n"; } } ?> Then I have the fallowing WSDL(companyService.wsdl):

    C#

  • Usercontrol and focus?
    S Snowjim

    Hey! I have a Usercontrol that contains several controls. There is onlye one of these controls that may ba focused by using tab(tab index = 1 and tabstop = true). The other controls in this usercontrol have index = 0 and tabstop = false. On the mouse over event on this focusable control i se the control to focus(ex this.txtBox.Focus();) and this works fine. But when i try to use Tab to leave the usercontrol there simes like another control get focused and I have to press tab twice to leave the usercontrol. Any ide how to lose the focus/activ of the usercontrol on TAB? I want the next usercontrol or regular control to become focused on one TAB press.

    C# database visual-studio tutorial question

  • Getting to know WCF questions.
    S Snowjim

    Hey! I am building on a simple chat application that uses callbacks. The contract are created in a class library that are then referd to in myWCFCallBackHost, the contract looks like this: Contract: namespace myWCFCallBackService { /// /// The interface the service exposes /// One Session to each client /// [ServiceContract(SessionMode=SessionMode.Required, CallbackContract = typeof(IChangedHandler))] public interface IChat { //Opens a new session when executed [OperationContract(IsOneWay=false, IsInitiating = true)] void Subscribe(string inName); //Close the current session bound to the current client [OperationContract(IsOneWay = false, IsTerminating = true)] void Unsubscribe(); //Lets the client post a message [OperationContract(IsOneWay = true)] void publishNewMessage(string inMessage, string inName); } /// /// The interface that clients must implement /// public interface IChangedHandler { [OperationContract(IsOneWay = true)] void changed(string newMessage); } /// /// A singelton object of the chat class to be able to subscribe clients /// [ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)] public class chat : IChat { private List mSubscribers = new List(); public chat() { } public void Subscribe(string inName) { mSubscribers.Add(OperationContext.Current.GetCallbackChannel()); } public void Unsubscribe() { IChangedHandler caller = OperationContext.Current.GetCallbackChannel(); foreach (IChangedHandler ch in mSubscribers) { if (ch == caller) { mSubscribers.Remove(ch); break; } } } public void publishNewMessage(string inMessage, string inName) { int nIndex = 0; try { foreach (IChangedHandler ch in mSubscribers) { ch.changed(inMessage); nIndex++; } } catch (Exception ex) { mSubscr

    .NET (Core and Framework) csharp wcf lounge

  • Unit testing Database problem[VS2005]
    S Snowjim

    Hey! I have looked allover the internet after a way to do unit testing against a database with rollback as easy and flexible as possible. I found this article: http://msdn.microsoft.com/msdnmag/issues/05/06/UnitTesting/[^] (http://msdn.microsoft.com/msdnmag/issues/05/06/UnitTesting/default.aspx?loc=&fig=true#fig5[^]) And I have tried to do the exact thing that roy Osherove shows. I have two projects(dbContextTest(class library) and dbContextTest_Test(Test project)) The following class are placed within the dbContextTest class and is that class that I want to test: public class userHandler { private databaseHandler dbHandler = new databaseHandler(); public bool createUser(string inFirstName, string inLastName) { try { if(dbHandler.createUser(inFirstName, inLastName) > 0) return true; return false; } catch (Exception ex) { Console.WriteLine("Error in " + this.ToString() + ".createUser : " + ex.Message); return false; } } } As you can see, I am here contacting the DAL(Database handler(dbHandler)) to add a user to the database. In my test project I have a userTest class where I have my test methods: [ClassInitialize()] public static void MyClassInitialize(TestContext testContext) { ServiceConfig config = new ServiceConfig(); config.Transaction = TransactionOption.RequiresNew; ServiceDomain.Enter(config); } [ClassCleanup()] public static void MyClassCleanup() { if (ContextUtil.IsInTransaction) ContextUtil.SetAbort(); ServiceDomain.Leave(); } [TestMethod()] public void createUser() { string firstName = "Olle"; string lastName = "Svensson"; userHandler tmpUSHandler = userFactory();

    C# help database com testing beta-testing

  • proved extra info for the membership?
    S Snowjim

    Hey! I am using framework 2.0 membership to handle my users on a site. It is posible to get information like name, isInRole and so on. But i need to also get the id nr of the current user. ex Page.User.Identity.Name I do not want to go to the mySQL server every time i need the id of a user, it shold be placed in session or cookie the same way the name is. Is this posible? and if, how? I am using a mySQL provider, what function is the mebership using to logon i user? Best Regards Jimmy

    ASP.NET mysql sysadmin question

  • Folder security
    S Snowjim

    Hey! I am about to build a photo site(using ASP.net 2.0 membership with roles) where users will be able to create there albums and upload images. The folder structure will look something like this. Solution *photoStore **Users ***Calle ****Album01 *****Thumbnail ******picture01.jpeg ******picture02.jpeg *****Medium ******picture01.jpeg ******picture02.jpeg *****Big ******picture01.jpeg ******picture02.jpeg ***Olle ****Album01 Etc This structure will make it easy to give a url to a specific image, for example: www.photosite.se/photoStore/Users/Calle/Album01/Medium/picture01.jpeg My wish is to be able to set permissions on these dynamic created folders. Maybe Calle have stated that Album01 should only be private, this means that by enter the url above only the user Calle should be able to see the images. I know that you can set permissions in web.config on folders, but i need to do this dynamically(if a user creates a new album he/she will be able to choose if the album should be private, public or maybe open for just some specific users). Is this possible to do? and if, how ? Best Regards Jimmy

    ASP.NET csharp asp-net security tutorial question

  • My Site
    S Snowjim

    Aha good ide, i will do that! =D

    IT & Infrastructure

  • My Site
    S Snowjim

    Hey! I need some feadback on my site that you can find at: www.znize.se[^] best regards Jimmy

    IT & Infrastructure

  • Source Safe 2005 problem
    S Snowjim

    Hey! I am having some problem to get the Visual Source Safe 2005 to work over the Internet. I am using my own computer as web server, this computer runs Windows XP pro. This is the steps I take: Create database: 1. Creates a dir on my G drive(G:\SourceSafe). 2. Starts VSS 2005 Administrator 3. File > Open Databas 4. Add > Create a new database 5. Then I browse to my G drive and locate the directory (G:\SourceSafe). 6. Source safe database is now created. Settings: 1. Starts VSS 2005 Administrator 2. Server > Configure 3. Checks the “Enable SourceSafe Internet for this computer” Create User: 1. Users > Add User 2. And then I create a user with password No I open the IIS and brows down to standard webplace. Here I find the SourceSafe created by the VSS 2005 Administrator. It contains the following folders: Data, temp and users, it also contains the files srcsafe.ini and users.txt. Connect the client: I am using my own computer again to connect to my web server(my computer). 1. Open Visual Studio 2005 2. Tools > Options > Source Control 3. Choose Microsoft Visual SourceSafe (Internet) from the dropdown box. OK 4. File > Open > WebSite(in this case, have also tried Project/Solution) 5. Choose Source Control > Select Source Control Poject 6. A Open Source Database shows and I choose Add 7. A Wizard starts > Next 8. No I am prompted to enter Address(http(s)://) and folder. 9. I use http://www.myip.dk/ to get my external web adr and enter it in the Address field. 10. My Folder would be SourceSafe. When I press next I get a Windows standard login window, with name and password. Here I enter the user I created in “Create User:”, but it will not grant me? I have tried to disabled the local firewall and I have also disabled the router(3com) firewall and placed my computer in DMZ zone just to be sure that none of them is the problem. What am I doing wrong? www.znize.se/jimmy

    C# csharp database visual-studio sysadmin windows-admin

  • Learn software testing?
    S Snowjim

    Hey! I have been programing for many years and some of the languages i manage is C/C++, Visual Basic.net, C# etc. Now i have become more interest of testing the software, mainly C code(within telecom). Of course i know how to make simple tests on my own software, but i want to learn how to REALLY test the software. I have already read some about white box, black box, function/unit/module testing and so on, but i feel that i need more information about how it works with testing of C code more practical. Maby you could help me understand this, maby you know of some good articles any help would be appreciate. Some questions: 1. How do i setup the test environment 2. what program can i use? can i do some heavy testing of C code with Visual studio 2005? if so, how? 3. Can i test C code with C# code? Best Regards Snowman

    IT & Infrastructure csharp question workspace c++

  • To get current week nr? is this wrong?
    S Snowjim

    If i set the year to 2007 and get the week nr from week 13(2007-03-26) to week 12(2008-03-17) then it counts the weeks wrong 2007-12-31 - 2008-01-06 is becoming week nr 53!? there is no week nr 53 in 2007. And thanks to this error the next week is missing(Week 1 2008(2008-01-07 - 2008-01-13))

    Visual Basic question

  • To get current week nr? is this wrong?
    S Snowjim

    Hey! I have hear that the framework are not counting the weeks right? will this code work? Dim cal As New System.Globalization.GregorianCalendar Return cal.GetWeekOfYear(inDate, Globalization.CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday)

    Visual Basic question

  • Date by Week nr?
    S Snowjim

    Thanks, i will try that, is this working even if the week of a year started last year?

    Visual Basic question

  • Date by Week nr?
    S Snowjim

    Thanks, i will try that, is this working even if the1 week of a year started last year?

    Visual Basic question

  • Date by Week nr?
    S Snowjim

    Thanks, i will tray that, is this working even if the1 week of a year started last year?

    Visual Basic question

  • Date by Week nr?
    S Snowjim

    Hey I have tryed to get date(Monday) by a week nr and year but this do not always work. Here is my code Public Function getDateByWeekNr(ByVal inWeekNr As Integer, ByVal inYear As Integer) As DateTime Dim cal As New System.Globalization.GregorianCalendar Dim dTime As DateTime dTime = New DateTime(inYear, 1, 1) For i As Integer = 0 To 365 If dTime.DayOfWeek = DayOfWeek.Monday Then Exit For Else dTime = dTime.Subtract(New TimeSpan(24, 0, 0)) End If Next Return cal.AddWeeks(dTime, inWeekNr) End Function what am i doing wrong?

    Visual Basic question

  • AJAX with ATLAS?
    S Snowjim

    Hey!:) I have been looking on the Microsoft ATLAS for ASP.NET 2.0 Now i have som questions: 1. I have a website and want to implement ATLAS in this site(not starting a new by the ATLAS TEMPLATE) is this posible? nad if, how? 2. If i have got it right i need to run a webservice to get ATLAS to work? is this posible from any webhotel that have ASP.NET 2.0 suport? or will i have to get a special webhotel? 3. Is ATLAS a good soulution go go with or do you recomend any other AJAX "plugins" to ASP.NET(2.0)? Best Regards Jimmy

    ASP.NET csharp asp-net question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups